Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions metadata/pixdecor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@
<_long>Color of the minimize, maximize and close buttons.</_long>
<default>0.0 0.0 0.0 1.0</default>
</option>
<option name="button_size" type="double">
<_short>Button Size</_short>
<_long>Changes the button size</_long>
<default>1.0</default>
</option>
<option name="button_line_thickness" type="double">
<_short>Button Line Thickness</_short>
<_long>The thickness used to draw the minimize, maximize and close button lines.</_long>
Expand Down
5 changes: 3 additions & 2 deletions src/deco-layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ wf::geometry_t pixdecor_layout_t::create_left_buttons(int width, int radius)
wf::option_wrapper_t<int> button_spacing{"pixdecor/left_button_spacing"};
wf::option_wrapper_t<int> button_x_offset{"pixdecor/left_button_x_offset"};
wf::option_wrapper_t<int> button_y_offset{"pixdecor/button_y_offset"};
wf::option_wrapper_t<double> button_size{"pixdecor/button_size"};
GSettings *settings = g_settings_new("org.gnome.desktop.wm.preferences");
gchar *b_layout = g_settings_get_string(settings, "button-layout");
gchar *ptr = b_layout;
Expand Down Expand Up @@ -139,8 +140,8 @@ wf::geometry_t pixdecor_layout_t::create_left_buttons(int width, int radius)
{
auto button_area = std::make_unique<decoration_area_t>(button_geometry, damage_callback, theme);
auto surface_size = button_area->as_button().set_button_type(type);
button_geometry.width = surface_size.width;
button_geometry.height = surface_size.height;
button_geometry.width = surface_size.width * button_size;
button_geometry.height = surface_size.height * button_size;
int button_padding = (theme.get_title_height() - button_geometry.height) / 2 + button_y_offset;
button_geometry.y = button_padding + border / 2 + (radius * 2);
per_button = button_geometry.width + (buttons.back() == type ? 0 : button_spacing);
Expand Down
2 changes: 2 additions & 0 deletions src/decoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class wayfire_pixdecor : public wf::plugin_interface_t
wf::option_wrapper_t<wf::color_t> bg_text_color{"pixdecor/bg_text_color"};
wf::option_wrapper_t<wf::color_t> button_color{"pixdecor/button_color"};
wf::option_wrapper_t<double> button_line_thickness{"pixdecor/button_line_thickness"};
wf::option_wrapper_t<double> button_size{"pixdecor/button_size"};
wf::option_wrapper_t<int> left_button_spacing{"pixdecor/left_button_spacing"};
wf::option_wrapper_t<int> right_button_spacing{"pixdecor/right_button_spacing"};
wf::option_wrapper_t<int> left_button_x_offset{"pixdecor/left_button_x_offset"};
Expand Down Expand Up @@ -427,6 +428,7 @@ class wayfire_pixdecor : public wf::plugin_interface_t
effect_animate.set_callback([=] {option_changed_cb(false, false);});
button_color.set_callback([=] {recreate_frames();});
button_line_thickness.set_callback([=] {recreate_frames();});
button_size.set_callback([=] {recreate_frames();});
left_button_spacing.set_callback([=] {recreate_frames();});
right_button_spacing.set_callback([=] {recreate_frames();});
left_button_x_offset.set_callback([=] {recreate_frames();});
Expand Down