workaround for MuxWindow icons if not in theme

also add title for windows in glade

tmp
This commit is contained in:
Jussi Kukkonen 2009-05-06 20:25:27 +03:00
parent 8f0611cc97
commit eab52086ce
2 changed files with 46 additions and 33 deletions

View file

@ -340,12 +340,23 @@ load_icon (MuxWindow *window, const char *icon_name)
pixbuf = gtk_icon_theme_load_icon (theme, icon_name,
48, 0, NULL);
/* FIXME: workaround until icons are in Moblin Netbook theme */
if (!pixbuf) {
char *str = g_strdup_printf ("%s/%s.png", THEMEDIR, icon_name);
pixbuf = gdk_pixbuf_new_from_file_at_size (str, 48, 48, NULL);
g_free (str);
}
if (!pixbuf) {
g_warning ("Icon '%s' not found in theme", icon_name);
pixbuf = gtk_widget_render_icon (GTK_WIDGET (window),
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_DIALOG,
NULL);
}
return pixbuf;
}
@ -375,8 +386,8 @@ mux_window_build_title_bar (MuxWindow *window)
gtk_widget_show (window->title_label);
if (window->decorations & MUX_DECOR_CLOSE) {
pixbuf = load_icon (window, "mux-window-close-normal");
pixbuf_hover = load_icon (window, "mux-window-close-prelight");
pixbuf = load_icon (window, "close");
pixbuf_hover = load_icon (window, "close_hover");
btn = g_object_new (MUX_TYPE_ICON_BUTTON,
"normal-state-pixbuf", pixbuf,
"prelight-state-pixbuf", pixbuf_hover,
@ -395,8 +406,8 @@ mux_window_build_title_bar (MuxWindow *window)
}
if (window->decorations & MUX_DECOR_SETTINGS) {
pixbuf = load_icon (window, "mux-window-settings-normal");
pixbuf_hover = load_icon (window, "mux-window-settings-prelight");
pixbuf = load_icon (window, "settings");
pixbuf_hover = load_icon (window, "settings_hover");
btn = g_object_new (MUX_TYPE_ICON_BUTTON,
"normal-state-pixbuf", pixbuf,
"prelight-state-pixbuf", pixbuf_hover,

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.5 on Fri Apr 24 13:50:07 2009 -->
<!--Generated with glade3 3.4.5 on Wed May 6 20:24:00 2009 -->
<glade-interface>
<widget class="GtkWindow" id="sync_win">
<property name="border_width">5</property>
<property name="title" translatable="yes">Sync</property>
<property name="default_width">800</property>
<property name="default_height">550</property>
<child>
@ -670,6 +671,7 @@ backup</property>
</widget>
<widget class="GtkWindow" id="services_win">
<property name="border_width">5</property>
<property name="title" translatable="yes">Sync</property>
<property name="modal">True</property>
<property name="default_width">800</property>
<property name="default_height">550</property>
@ -953,7 +955,7 @@ you can setup a service manually.</property>
</widget>
<widget class="GtkWindow" id="service_settings_win">
<property name="border_width">5</property>
<property name="title" translatable="yes">Sync service settings</property>
<property name="title" translatable="yes">Sync</property>
<property name="modal">True</property>
<property name="default_width">800</property>
<property name="default_height">550</property>
@ -1007,27 +1009,35 @@ you can setup a service manually.</property>
<property name="column_spacing">5</property>
<property name="row_spacing">4</property>
<child>
<widget class="GtkLabel" id="label10">
<widget class="GtkEntry" id="service_name_entry">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Password</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="service_name_label">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Service name</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label9">
<widget class="GtkEntry" id="username_entry">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Username</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
@ -1044,35 +1054,27 @@ you can setup a service manually.</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="username_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="service_name_label">
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Service name</property>
<property name="label" translatable="yes">Username</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="service_name_entry">
<widget class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Password</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
</widget>