Skip to content

Commit 0d3d68e

Browse files
AKArientrigg
authored andcommitted
panel : mixer : change vertical layout option to general layout option
A general layout option is cleaner and clearer. The two current layouts aren’t so different, but it also allows for further layouts to be added.
1 parent 1a60bfa commit 0d3d68e

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

metadata/panel.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,18 @@ If full_span is off, both sides of the panel will take the same amount of space,
409409
<_long>Displays the mute and set default icon on the left</_long>
410410
<default>false</default>
411411
</option>
412-
<option name="mixer_stack_categories" type="bool">
413-
<_short>Stack categories</_short>
414-
<_long>Displays the outputs, inputs and streams stacked on top of each other instead of side by side</_long>
415-
<default>false</default>
412+
<option name="mixer_layout" type="string">
413+
<_short>Layout</_short>
414+
<_long>Type of layout in which to arrange the mixer</_long>
415+
<default>horizontal</default>
416+
<desc>
417+
<value>horizontal</value>
418+
<_name>Horizontal</_name>
419+
</desc>
420+
<desc>
421+
<value>vertical</value>
422+
<_name>Vertical</_name>
423+
</desc>
416424
</option>
417425
<option name="mixer_spacing" type="int">
418426
<_short>Spacing between controls</_short>

src/panel/widgets/mixer/mixer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ void WayfireMixer::reload_config()
2323
set_spacing(sources_box);
2424
set_spacing(streams_box);
2525

26-
master_box.set_orientation(stack_categories ? Gtk::Orientation::VERTICAL : Gtk::Orientation::HORIZONTAL);
26+
if (layout.value() == "vertical")
27+
{
28+
master_box.set_orientation(Gtk::Orientation::VERTICAL);
29+
} else // horizontal
30+
{
31+
master_box.set_orientation(Gtk::Orientation::HORIZONTAL);
32+
}
2733

2834
// big matching operation
2935
static WfOption<std::string> str_quick_target_choice{"panel/mixer_quick_target_choice"};

src/panel/widgets/mixer/mixer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class WayfireMixer : public WayfireWidget
2929
Gtk::Image main_image;
3030

3131
WfOption<int> spacing{"panel/mixer_spacing"};
32-
WfOption<bool> stack_categories{"panel/mixer_stack_categories"};
32+
WfOption<std::string> layout{"panel/mixer_layout"};
3333

3434
void on_volume_value_changed();
3535

0 commit comments

Comments
 (0)