libgimpwidgets, theme: Group radio buttons together
This patch swaps out the GtkBox in gimp_enum_icon_box_new_with_toggle () with a GtkButtonBox and sets it to EXPAND so that the buttons are pressed together. It also adds some CSS style to complete the effect.
This commit is contained in:
parent
e1235f3510
commit
5fde1b9e89
7 changed files with 90 additions and 1 deletions
|
|
@ -907,6 +907,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
|
|||
|
||||
box = gimp_prop_enum_icon_box_new (config, "justify", "format-justify", 0, 0);
|
||||
gtk_widget_set_halign (box, GTK_ALIGN_START);
|
||||
gtk_box_set_homogeneous (GTK_BOX (box), FALSE);
|
||||
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
||||
_("Justify:"), 0.0, 0.5,
|
||||
box, 2);
|
||||
|
|
|
|||
|
|
@ -146,12 +146,14 @@ gimp_stroke_editor_constructed (GObject *object)
|
|||
|
||||
box = gimp_prop_enum_icon_box_new (G_OBJECT (options), "cap-style",
|
||||
"gimp-cap", 0, 0);
|
||||
gtk_widget_set_halign (box, GTK_ALIGN_START);
|
||||
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
||||
_("_Cap style:"), 0.0, 0.5,
|
||||
box, 2);
|
||||
|
||||
box = gimp_prop_enum_icon_box_new (G_OBJECT (options), "join-style",
|
||||
"gimp-join", 0, 0);
|
||||
gtk_widget_set_halign (box, GTK_ALIGN_START);
|
||||
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
|
||||
_("_Join style:"), 0.0, 0.5,
|
||||
box, 2);
|
||||
|
|
|
|||
|
|
@ -372,7 +372,8 @@ gimp_enum_icon_box_new_with_range (GType enum_type,
|
|||
|
||||
enum_class = g_type_class_ref (enum_type);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_EXPAND);
|
||||
g_object_weak_ref (G_OBJECT (hbox),
|
||||
(GWeakNotify) g_type_class_unref, enum_class);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,3 +42,7 @@ GimpSpinScale entry progress {
|
|||
progressbar trough progress {
|
||||
background-color: @hover-color;
|
||||
}
|
||||
|
||||
buttonbox button.radio:not(:checked) {
|
||||
background-color: @stronger-border-color;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,3 +25,7 @@ paned.vertical > separator {
|
|||
button:not(.flat) {
|
||||
box-shadow: 0 1px @extreme-bg-color inset;
|
||||
}
|
||||
|
||||
buttonbox button.radio:not(:checked) {
|
||||
box-shadow: 0 1px @extreme-bg-color inset;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -657,6 +657,31 @@ button.radio image {
|
|||
padding: 4px;
|
||||
}
|
||||
|
||||
/* Create appearance of toggle group for enum radio buttons */
|
||||
buttonbox.horizontal button.radio
|
||||
{
|
||||
border-top: 1px solid @edge-border-color;
|
||||
border-bottom: 1px solid @edge-border-color;
|
||||
border-left: 1px solid @edge-border-color;
|
||||
}
|
||||
|
||||
buttonbox.horizontal button.radio:last-child
|
||||
{
|
||||
border-right: 1px solid @edge-border-color;
|
||||
}
|
||||
|
||||
buttonbox.vertical button.radio
|
||||
{
|
||||
border-top: 1px solid @edge-border-color;
|
||||
border-left: 1px solid @edge-border-color;
|
||||
border-right: 1px solid @edge-border-color;
|
||||
}
|
||||
|
||||
buttonbox.vertical button.radio:last-child
|
||||
{
|
||||
border-bottom: 1px solid @edge-border-color;
|
||||
}
|
||||
|
||||
/* Removes "blurred" effect from tooltip label */
|
||||
tooltip {
|
||||
background-color: @bg-color;
|
||||
|
|
|
|||
|
|
@ -126,6 +126,58 @@ GimpSpinScale button {
|
|||
padding: 0 1px 0 1px;
|
||||
}
|
||||
|
||||
|
||||
/* Create appearance of toggle group for enum radio buttons */
|
||||
buttonbox button.radio
|
||||
{
|
||||
min-height: 24px;
|
||||
min-width: 16px;
|
||||
outline-width: 0px;
|
||||
}
|
||||
|
||||
buttonbox button.radio image
|
||||
{
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
buttonbox.horizontal button.radio
|
||||
{
|
||||
border-top: 1px solid @borders;
|
||||
border-bottom: 1px solid @borders;
|
||||
border-left: 1px solid @borders;
|
||||
}
|
||||
|
||||
buttonbox.horizontal button.radio:last-child
|
||||
{
|
||||
border-right: 1px solid @borders;
|
||||
}
|
||||
|
||||
buttonbox.vertical button.radio
|
||||
{
|
||||
border-top: 1px solid @borders;
|
||||
border-left: 1px solid @borders;
|
||||
border-right: 1px solid @borders;
|
||||
}
|
||||
|
||||
buttonbox.vertical button.radio:last-child
|
||||
{
|
||||
border-bottom: 1px solid @borders;
|
||||
}
|
||||
|
||||
buttonbox.horizontal button.radio:not(:first-child)
|
||||
{
|
||||
margin-right: -1px;
|
||||
}
|
||||
|
||||
buttonbox.vertical button.radio:not(:first-child)
|
||||
{
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
combobox button {
|
||||
outline-width: 0px;
|
||||
}
|
||||
|
||||
entry.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue