widget-factory: Add tab close buttons

This will make it easier to fix issues with such buttons
in HighContrast.
This commit is contained in:
Matthias Clasen 2015-03-15 22:42:44 -04:00
parent 5dfbeb978f
commit de239ca31b
5 changed files with 78 additions and 5 deletions

View File

@ -62,6 +62,7 @@ uninstall-update-icon-cache:
EXTRA_DIST += \
widget-factory.ui \
widget-factory.css \
menus.ui \
widget-factory.gresource.xml \
data/source.svg \

View File

@ -1157,7 +1157,7 @@ activate (GApplication *app)
g_type_ensure (my_text_view_get_type ());
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);

View File

@ -0,0 +1,9 @@
.circular-button {
border-radius: 20px;
outline-radius: 20px;
}
.small-button {
padding: 0;
outline-width: 0;
}

View File

@ -3,6 +3,9 @@
<gresource prefix="/org/gtk/WidgetFactory">
<file preprocess="xml-stripblanks">widget-factory.ui</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory">
<file>widget-factory.css</file>
</gresource>
<gresource prefix="/org/gtk/WidgetFactory/gtk">
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>

View File

@ -3857,11 +3857,41 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="height-request">120</property>
</object>
<packing>
<property name="tab-expand">True</property>
<property name="tab-fill">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<object class="GtkBox">
<property name="visible">True</property>
<property name="label" translatable="yes">Page 1</property>
<property name="orientation">horizontal</property>
<child type="center">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Page 1</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="relief">none</property>
<property name="focus-on-click">False</property>
<style>
<class name="small-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
<child>
@ -3869,11 +3899,41 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="tab-expand">True</property>
<property name="tab-fill">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<object class="GtkBox">
<property name="visible">True</property>
<property name="label" translatable="yes">Page 2</property>
<property name="orientation">horizontal</property>
<child type="center">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Page 2</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="relief">none</property>
<property name="focus-on-click">False</property>
<style>
<class name="small-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
</object>