[gnumeric] Cell Format: keep up with font selector changes.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Cell Format: keep up with font selector changes.
- Date: Thu, 21 Mar 2013 03:10:56 +0000 (UTC)
commit 800d897f460642a52c072b364e4f8b145579b39d
Author: Morten Welinder <terra gnome org>
Date: Wed Mar 20 23:10:19 2013 -0400
Cell Format: keep up with font selector changes.
The script selector is now fully in the font selector.
src/dialogs/cell-format.ui | 46 +----------------------------------
src/dialogs/dialog-cell-format.c | 48 +------------------------------------
2 files changed, 4 insertions(+), 90 deletions(-)
---
diff --git a/src/dialogs/cell-format.ui b/src/dialogs/cell-format.ui
index 6888fbd..1b225e3 100644
--- a/src/dialogs/cell-format.ui
+++ b/src/dialogs/cell-format.ui
@@ -551,49 +551,13 @@
<property name="use_underline">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
+ <property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="superscript_button">
- <property name="label" translatable="yes">Sup_erscript</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">end</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="subscript_button">
- <property name="label" translatable="yes">Su_bscript</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="GtkBox" id="underline_placeholder">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -602,7 +566,7 @@
</child>
</object>
<packing>
- <property name="left_attach">3</property>
+ <property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -629,12 +593,6 @@
<child>
<placeholder/>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="position">1</property>
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 0b94528..3b0328b 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -150,8 +150,6 @@ typedef struct _FormatState {
} align;
struct {
GOFontSel *selector;
- GtkToggleButton *superscript, *subscript;
- ColorPicker color;
} font;
struct {
GocCanvas *canvas;
@@ -837,36 +835,6 @@ set_font_underline (FormatState *state, GnmUnderline u)
change_font_attr (state, pango_attr_underline_new (pu));
}
-static void
-set_font_script (FormatState *state, GOFontScript s)
-{
- gboolean is_super = (s == GO_FONT_SCRIPT_SUPER);
- gboolean is_sub = (s == GO_FONT_SCRIPT_SUB);
-
- change_font_attr (state, go_pango_attr_subscript_new (is_sub));
- change_font_attr (state, go_pango_attr_superscript_new (is_super));
-}
-
-static void
-cb_font_script_toggle (GtkToggleButton *button, FormatState *state)
-{
- if (state->enable_edit) {
- GOFontScript script = GO_FONT_SCRIPT_STANDARD;
- if (gtk_toggle_button_get_active (button)) {
- state->enable_edit = FALSE;
- if (button == state->font.superscript) {
- script = GO_FONT_SCRIPT_SUPER;
- gtk_toggle_button_set_active (state->font.subscript, FALSE);
- } else {
- script = GO_FONT_SCRIPT_SUB;
- gtk_toggle_button_set_active (state->font.superscript, FALSE);
- }
- state->enable_edit = TRUE;
- }
- set_font_script (state, script);
- }
-}
-
static gboolean
cb_font_underline_changed (GtkComboBoxText *combo,
FormatState *state)
@@ -911,13 +879,13 @@ fmt_dialog_init_font_page (FormatState *state)
g_return_if_fail (uline != NULL);
def_sc = style_color_auto_font ();
- /* FIXME: Use def_sc */
cg = go_color_group_fetch ("fore_color_group", NULL);
font_widget = g_object_new (GO_TYPE_FONT_SEL,
"show-style", TRUE,
"show-color", TRUE,
"color-unset-text", _("Automatic"),
"color-group", cg,
+ "color-default", def_sc->go_color,
"show-script", TRUE,
"show-strikethrough", TRUE,
"vexpand", TRUE,
@@ -999,19 +967,7 @@ fmt_dialog_init_font_page (FormatState *state)
if (0 == (state->conflicts & (1 << MSTYLE_FONT_SCRIPT)))
script = gnm_style_get_font_script (state->style);
- set_font_script (state, script);
-
- state->font.superscript = GTK_TOGGLE_BUTTON (go_gtk_builder_get_widget (state->gui,
"superscript_button"));
- gtk_toggle_button_set_active (state->font.superscript,
- script == GO_FONT_SCRIPT_SUPER);
- g_signal_connect (G_OBJECT (state->font.superscript), "toggled",
- G_CALLBACK (cb_font_script_toggle), state);
-
- state->font.subscript = GTK_TOGGLE_BUTTON (go_gtk_builder_get_widget (state->gui,
"subscript_button"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (state->font.subscript),
- script == GO_FONT_SCRIPT_SUB);
- g_signal_connect (G_OBJECT (state->font.subscript), "toggled",
- G_CALLBACK (cb_font_script_toggle), state);
+ go_font_sel_set_script (state->font.selector, script);
if (0 == (state->conflicts & (1 << MSTYLE_FONT_COLOR)))
change_font_attr
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]