summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-04-21 16:31:22 +0200
committermonsta <[email protected]>2018-04-29 15:02:42 +0300
commitbc795840feb89b3d764913ec43aeb8299f922c88 (patch)
tree0dc51164570b4446a2e672c2c0ae22263fd46cc2
parent8b287d0d0bc78dec6a0b71f7b47bb56eae02be71 (diff)
downloadmate-panel-bc795840feb89b3d764913ec43aeb8299f922c88.tar.bz2
mate-panel-bc795840feb89b3d764913ec43aeb8299f922c88.tar.xz
limit size of panel-hide-button
Thanks to Juha Leppänen, Kuopio, Finland for simplifing the code
-rw-r--r--mate-panel/panel-toplevel.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c
index e9d9fe48..d3fd0dcd 100644
--- a/mate-panel/panel-toplevel.c
+++ b/mate-panel/panel-toplevel.c
@@ -1287,9 +1287,9 @@ static void panel_toplevel_update_hide_buttons_size(GtkWidget* button, int panel
} else if (panel_size < 40) {
gtk_image_set_pixel_size (GTK_IMAGE (arrow), 16);
} else if (panel_size < 60) {
- gtk_image_set_pixel_size (GTK_IMAGE (arrow), 24);
+ gtk_image_set_pixel_size (GTK_IMAGE (arrow), 22);
} else {
- gtk_image_set_pixel_size (GTK_IMAGE (arrow), 32);
+ gtk_image_set_pixel_size (GTK_IMAGE (arrow), 24);
}
}
@@ -1298,6 +1298,7 @@ static void panel_toplevel_update_hide_buttons(PanelToplevel* toplevel)
{
int panel_size = toplevel->priv->size;
+ int hb_size = 0;
if (toplevel->priv->buttons_enabled) {
panel_toplevel_update_buttons_showing (toplevel);
@@ -1343,10 +1344,16 @@ static void panel_toplevel_update_hide_buttons(PanelToplevel* toplevel)
/* set size after setting the arrow */
if (toplevel->priv->buttons_enabled) {
- gtk_widget_set_size_request (toplevel->priv->hide_button_top, panel_size, panel_size);
- gtk_widget_set_size_request (toplevel->priv->hide_button_bottom, panel_size, panel_size);
- gtk_widget_set_size_request (toplevel->priv->hide_button_left, panel_size, panel_size);
- gtk_widget_set_size_request (toplevel->priv->hide_button_right, panel_size, panel_size);
+
+ if ( panel_size < 20) { hb_size = 16; }
+ else if ( panel_size < 40) { hb_size = 20; }
+ else if ( panel_size < 60) { hb_size = 26; }
+ else { hb_size = 30; }
+
+ gtk_widget_set_size_request (toplevel->priv->hide_button_top, panel_size, hb_size);
+ gtk_widget_set_size_request (toplevel->priv->hide_button_bottom, panel_size, hb_size);
+ gtk_widget_set_size_request (toplevel->priv->hide_button_left, hb_size, panel_size);
+ gtk_widget_set_size_request (toplevel->priv->hide_button_right, hb_size, panel_size);
}
}