Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wide panels sizes (vert/horz) #2

Merged
merged 1 commit into from
Aug 22, 2018
Merged
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
28 changes: 25 additions & 3 deletions mate-panel/button-widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,14 @@ button_widget_get_preferred_width (GtkWidget *widget,

parent = gtk_widget_get_parent (widget);

if (button_widget->priv->orientation & PANEL_HORIZONTAL_MASK)
if (button_widget->priv->orientation & PANEL_HORIZONTAL_MASK){
size = gtk_widget_get_allocated_height (parent);
else

/* should get this value (50) from gsettings, user defined value in properties of the panel (max_icon_size) OR use 48*/
if ( size > 50 )
size = 50;

} else
size = gtk_widget_get_allocated_width (parent);

*minimal_width = *natural_width = size;
Expand All @@ -467,8 +472,14 @@ button_widget_get_preferred_height (GtkWidget *widget,

if (button_widget->priv->orientation & PANEL_HORIZONTAL_MASK)
size = gtk_widget_get_allocated_height (parent);
else
else {
size = gtk_widget_get_allocated_width (parent);

/* should get this value (50) from gsettings, user defined value in properties of the panel (max_icon_size) OR use 48*/
if ( size > 50 )
size = 50;

}

*minimal_height = *natural_height = size;
}
Expand All @@ -480,6 +491,17 @@ button_widget_size_allocate (GtkWidget *widget,
ButtonWidget *button_widget = BUTTON_WIDGET (widget);
int size;

/* should get this value (50) from gsettings, user defined value in properties of the panel (max_icon_size) OR use 48?*/
if (button_widget->priv->orientation & PANEL_HORIZONTAL_MASK) {
if ( allocation->height > 50 ) {
allocation->width = 50;
}
} else {
if ( allocation->width > 50 ) {
allocation->height = 50;
}
}

GTK_WIDGET_CLASS (button_widget_parent_class)->size_allocate (widget, allocation);

if (button_widget->priv->orientation & PANEL_HORIZONTAL_MASK)
Expand Down