[glade3] * src/glade-window.c: Fixed style for notebook tab progress bar to be set with css.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * src/glade-window.c: Fixed style for notebook tab progress bar to be set with css.
- Date: Wed, 22 Dec 2010 13:47:59 +0000 (UTC)
commit 85a774dbe6f1f2aae95bbfec0c235d9b11914df3
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Dec 22 22:54:08 2010 +0900
* src/glade-window.c: Fixed style for notebook tab progress bar to be set with css.
ChangeLog | 2 ++
src/glade-window.c | 29 ++++++++++++++++++-----------
2 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 073a0e7..61f8859 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,8 @@
* data/...: mv gladeui-3.0.pc.in gladeui-2.0.pc.in (its libgladeui-2.0, not 3.0), also
moved glade-3.desktop.in.in to glade.desktop.in.in, new app name is 'glade'.
+ * src/glade-window.c: Fixed style for notebook tab progress bar to be set with css.
+
2010-12-22 Tristan Van Berkom <tristanvb openismus com>
* gladeui/glade-project.[ch]: Removed dialog and added "load-progress" signal
diff --git a/src/glade-window.c b/src/glade-window.c
index 7c5cac4..0b97966 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -2524,6 +2524,7 @@ create_notebook_tab (GladeWindow *window, GladeProject *project, gboolean for_fi
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
progress = gtk_progress_bar_new ();
+ gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (progress), TRUE);
gtk_widget_add_events (progress,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
gtk_widget_set_name (progress, "glade-tab-label-progress");
@@ -3462,6 +3463,7 @@ glade_window_class_init (GladeWindowClass *klass)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
+ GtkCssProvider *provider;
object_class = G_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
@@ -3471,17 +3473,22 @@ glade_window_class_init (GladeWindowClass *klass)
widget_class->configure_event = glade_window_configure_event;
- gtk_rc_parse_string ("style \"short_progress\"\n"
- " { \n"
- " GtkProgressBar::min-horizontal-bar-height = 1\n"
- " GtkProgressBar::min-horizontal-bar-width = 1\n"
- " GtkProgressBar::yspacing = 0\n"
- " GtkProgressBar::xspacing = 4\n"
- " xthickness = 0\n"
- " ythickness = 0\n"
- " }\n"
- "\n"
- "widget \"*.glade-tab-label-progress\" style \"short_progress\"");
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "GtkProgressBar#glade-tab-label-progress {\n"
+ " -GtkProgressBar-min-horizontal-bar-width : 1;\n"
+ " -GtkProgressBar-min-horizontal-bar-height : 1;\n"
+ " -GtkProgressBar-xspacing : 4;\n"
+ " -GtkProgressBar-yspacing : 0;\n"
+ " xthickness : 0;\n"
+ " ythickness : 0;\n"
+ " }",
+ -1, NULL);
+
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
g_type_class_add_private (klass, sizeof (GladeWindowPrivate));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]