static gboolean mapping = FALSE;
-static RrFont *read_font(GtkFontButton *w, const gchar *place);
+static RrFont *read_font(GtkFontButton *w, const gchar *place, gboolean def);
static RrFont *write_font(GtkFontButton *w, const gchar *place);
void appearance_setup_tab()
g_free(layout);
w = get_widget("font_active");
- f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow");
+ f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow", TRUE);
preview_update_set_active_font(f);
w = get_widget("font_inactive");
- f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow");
+ f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow", TRUE);
preview_update_set_inactive_font(f);
w = get_widget("font_menu_header");
- f = read_font(GTK_FONT_BUTTON(w), "MenuHeader");
+ f = read_font(GTK_FONT_BUTTON(w), "MenuHeader", TRUE);
preview_update_set_menu_header_font(f);
w = get_widget("font_menu_item");
- f = read_font(GTK_FONT_BUTTON(w), "MenuItem");
+ f = read_font(GTK_FONT_BUTTON(w), "MenuItem", TRUE);
preview_update_set_menu_item_font(f);
- w = get_widget("font_display");
- f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay");
- preview_update_set_osd_font(f);
+ w = get_widget("font_active_display");
+ if (!(f = read_font(GTK_FONT_BUTTON(w), "ActiveOnScreenDisplay", FALSE))) {
+ f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay", TRUE);
+ tree_delete_node("theme/font:place=OnScreenDisplay");
+ }
+ preview_update_set_osd_active_font(f);
+
+ w = get_widget("font_inactive_display");
+ f = read_font(GTK_FONT_BUTTON(w), "InactiveOnScreenDisplay", TRUE);
+ preview_update_set_osd_inactive_font(f);
mapping = FALSE;
}
preview_update_set_menu_item_font(write_font(w, "MenuItem"));
}
-void on_font_display_font_set(GtkFontButton *w, gpointer data)
+void on_font_active_display_font_set(GtkFontButton *w, gpointer data)
{
if (mapping) return;
- preview_update_set_osd_font(write_font(w, "OnScreenDisplay"));
+ preview_update_set_osd_active_font(write_font(w, "ActiveOnScreenDisplay"));
}
-static RrFont *read_font(GtkFontButton *w, const gchar *place)
+void on_font_inactive_display_font_set(GtkFontButton *w, gpointer data)
+{
+ if (mapping) return;
+
+ preview_update_set_osd_inactive_font
+ (write_font(w, "InactiveOnScreenDisplay"));
+}
+
+static RrFont *read_font(GtkFontButton *w, const gchar *place,
+ gboolean use_default)
{
RrFont *font;
gchar *fontstring, *node;
mapping = TRUE;
node = g_strdup_printf("theme/font:place=%s/name", place);
- name = tree_get_string(node, "Sans");
+ name = tree_get_string(node, use_default ? "Sans" : NULL);
g_free(node);
+ if (name[0] == '\0') {
+ g_free(name);
+ return NULL;
+ }
+
node = g_strdup_printf("theme/font:place=%s/size", place);
size = tree_get_string(node, "8");
g_free(node);
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="n_rows">5</property>
+ <property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
</packing>
</child>
- <child>
- <widget class="GtkFontButton" id="font_display">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_style">True</property>
- <property name="show_size">True</property>
- <property name="use_font">True</property>
- <property name="use_size">False</property>
- <property name="focus_on_click">True</property>
- <signal name="font_set" handler="on_font_display_font_set" last_modification_time="Fri, 25 May 2007 16:03:23 GMT"/>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
<child>
<widget class="GtkLabel" id="label94">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label98">
<property name="visible">True</property>
- <property name="label" translatable="yes">_On-screen display: </property>
+ <property name="label" translatable="yes">Active _On-screen display: </property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="mnemonic_widget">font_display</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkLabel" id="label240">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Inactive O_n-screen display: </property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFontButton" id="font_active_display">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_style">True</property>
+ <property name="show_size">True</property>
+ <property name="use_font">True</property>
+ <property name="use_size">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="font_set" handler="on_font_active_display_font_set" last_modification_time="Mon, 21 Dec 2009 16:08:46 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFontButton" id="font_inactive_display">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_style">True</property>
+ <property name="show_size">True</property>
+ <property name="use_font">True</property>
+ <property name="use_size">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="font_set" handler="on_font_inactive_display_font_set" last_modification_time="Mon, 21 Dec 2009 16:08:52 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox86">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label243">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span weight="bold">Primary Monitor</span></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox120">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label244">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox87">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox122">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label246">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">The primary monitor is where Openbox will place dialogs, such as the one used for cycling windows.</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">0</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox121">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label245">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Primary _monitor:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">primary_monitor_popup</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkOptionMenu" id="primary_monitor_popup">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="history">1</property>
+
+ <child>
+ <widget class="GtkMenu" id="menu16">
+
+ <child>
+ <widget class="GtkMenuItem" id="item1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Fixed Monitor</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_primary_monitor_fixed_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="active_monitor1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Active Monitor</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_primary_monitor_active_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="monitor_with_mouse_pointer1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Monitor With Mouse Pointer</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_primary_monitor_mouse_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox123">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label249">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label248">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Fixed monitor:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">fixed_monitor</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="fixed_monitor">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">1 1 100 1 10 10</property>
+ <signal name="value_changed" handler="on_fixed_monitor_value_changed" last_modification_time="Mon, 21 Dec 2009 18:32:45 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="tab_expand">False</property>