Commit 0b96b8a1 authored by Timm Bäder's avatar Timm Bäder 👎

GtkModelButton: Remove some margins

Now that we can use margins from css for this, remove the margins we set
in code and use css instead.
parent 2f61bc18
......@@ -496,12 +496,6 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
box->separator = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_ref_sink (box->separator);
g_object_set (box->separator,
"margin-start", 12,
"margin-end", 12,
"margin-top", 6,
"margin-bottom", 3,
NULL);
gtk_container_add (GTK_CONTAINER (box->separator), title);
gtk_container_add (GTK_CONTAINER (box->separator), separator);
gtk_widget_show_all (box->separator);
......@@ -511,12 +505,6 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
box->separator = separator;
g_object_ref_sink (box->separator);
g_object_set (box->separator,
"margin-start", 12,
"margin-end", 12,
"margin-top", 3,
"margin-bottom", 3,
NULL);
gtk_widget_show (box->separator);
}
......
......@@ -1209,15 +1209,10 @@ gtk_model_button_init (GtkModelButton *button)
button->role = GTK_BUTTON_ROLE_NORMAL;
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_margin_start (button->box, 12);
gtk_widget_set_margin_end (button->box, 12);
gtk_widget_set_margin_top (button->box, 3);
gtk_widget_set_margin_bottom (button->box, 3);
gtk_widget_set_halign (button->box, GTK_ALIGN_FILL);
gtk_widget_show (button->box);
button->image = gtk_image_new ();
gtk_widget_set_no_show_all (button->image, TRUE);
g_object_set (button->image, "margin", 4, NULL);
button->label = gtk_label_new ("");
gtk_widget_set_no_show_all (button->label, TRUE);
gtk_container_add (GTK_CONTAINER (button->box), button->image);
......
......@@ -728,13 +728,25 @@ toolbar.inline-toolbar toolbutton:backdrop {
/* menu buttons */
modelbutton.flat,
.menuitem.button.flat {
min-height: 26px;
padding-left: 5px;
padding-right: 5px;
border-radius: 3px;
outline-offset: -2px;
@extend %undecorated_button;
outline-offset: -1px;
&:hover { background-color: mix($fg_color, $bg_color, 10%); }
&:selected { @extend %selected_items; }
&:backdrop, &:backdrop:hover {
@extend %undecorated_button;
}
// FIXME: remove the following when the checks/radios rewrite lands
check:last-child,
radio:last-child { margin-left: 8px; }
check:first-child,
radio:first-child { margin-right: 8px; }
}
modelbutton.flat arrow {
......@@ -1630,10 +1642,6 @@ popover.background {
transition: none;
}
button.model.image-button {
padding: 0px;
}
.csd &, & {
&.touch-selection,
&.magnifier {
......@@ -1644,6 +1652,8 @@ popover.background {
&.osd { @extend %osd; }
}
separator { margin: 3px; }
}
/*************
......
......@@ -1227,10 +1227,24 @@ notebook tab .titlebar button.titlebutton,
/* menu buttons */
modelbutton.flat,
.menuitem.button.flat {
outline-offset: -1px; }
min-height: 26px;
padding-left: 5px;
padding-right: 5px;
border-radius: 3px;
outline-offset: -2px; }
modelbutton.flat:hover,
.menuitem.button.flat:hover {
background-color: #4b5150; }
modelbutton.flat check:last-child,
modelbutton.flat radio:last-child,
.menuitem.button.flat check:last-child,
.menuitem.button.flat radio:last-child {
margin-left: 8px; }
modelbutton.flat check:first-child,
modelbutton.flat radio:first-child,
.menuitem.button.flat check:first-child,
.menuitem.button.flat radio:first-child {
margin-right: 8px; }
modelbutton.flat arrow {
background: none; }
......@@ -2216,12 +2230,10 @@ popover.background {
.titlebar popover.background button.titlebutton:hover {
text-shadow: none;
transition: none; }
popover.background button.model.image-button, popover.background headerbar button.model.titlebutton, headerbar popover.background button.model.titlebutton,
popover.background .titlebar button.model.titlebutton,
.titlebar popover.background button.model.titlebutton {
padding: 0px; }
.csd popover.background.touch-selection, .csd popover.background.magnifier, popover.background.touch-selection, popover.background.magnifier {
border: 1px solid rgba(255, 255, 255, 0.1); }
popover.background separator {
margin: 3px; }
/*************
* Notebooks *
......
......@@ -1227,10 +1227,24 @@ notebook tab .titlebar button.titlebutton,
/* menu buttons */
modelbutton.flat,
.menuitem.button.flat {
outline-offset: -1px; }
min-height: 26px;
padding-left: 5px;
padding-right: 5px;
border-radius: 3px;
outline-offset: -2px; }
modelbutton.flat:hover,
.menuitem.button.flat:hover {
background-color: #d5d6d5; }
modelbutton.flat check:last-child,
modelbutton.flat radio:last-child,
.menuitem.button.flat check:last-child,
.menuitem.button.flat radio:last-child {
margin-left: 8px; }
modelbutton.flat check:first-child,
modelbutton.flat radio:first-child,
.menuitem.button.flat check:first-child,
.menuitem.button.flat radio:first-child {
margin-right: 8px; }
modelbutton.flat arrow {
background: none; }
......@@ -2222,12 +2236,10 @@ popover.background {
.titlebar popover.background button.titlebutton:hover {
text-shadow: none;
transition: none; }
popover.background button.model.image-button, popover.background headerbar button.model.titlebutton, headerbar popover.background button.model.titlebutton,
popover.background .titlebar button.model.titlebutton,
.titlebar popover.background button.model.titlebutton {
padding: 0px; }
.csd popover.background.touch-selection, .csd popover.background.magnifier, popover.background.touch-selection, popover.background.magnifier {
border: 1px solid rgba(255, 255, 255, 0.1); }
popover.background separator {
margin: 3px; }
/*************
* Notebooks *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment