mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add preference to control toolbar appearance
Add preferences to select icon size and item layout on the toolbar. Fixes Bug 796739 - Toolbar buttons have no labels, part 1 of 3.
This commit is contained in:
committed by
John Ralls
parent
3e37b87997
commit
3b09313107
@@ -1229,6 +1229,8 @@ gnc_preferences_dialog_create(GtkWindow *parent)
|
|||||||
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "retain_days_adj");
|
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "retain_days_adj");
|
||||||
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "tab_width_adj");
|
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "tab_width_adj");
|
||||||
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_formats");
|
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_formats");
|
||||||
|
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-styles");
|
||||||
|
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-icon-sizes");
|
||||||
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "gnucash_preferences_dialog");
|
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "gnucash_preferences_dialog");
|
||||||
|
|
||||||
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_preferences_dialog"));
|
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_preferences_dialog"));
|
||||||
|
|||||||
@@ -3341,6 +3341,28 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
|
|||||||
LEAVE ("");
|
LEAVE ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnc_main_window_update_toolbar (gpointer prefs, gchar *pref, gpointer user_data)
|
||||||
|
{
|
||||||
|
GncMainWindow *window;
|
||||||
|
GtkToolbar *tb;
|
||||||
|
GncMainWindowPrivate *priv;
|
||||||
|
gint selection;
|
||||||
|
|
||||||
|
window = GNC_MAIN_WINDOW(user_data);
|
||||||
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
|
||||||
|
tb = GTK_TOOLBAR(priv->toolbar);
|
||||||
|
|
||||||
|
selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
|
||||||
|
if (gtk_toolbar_get_style (tb) != selection)
|
||||||
|
gtk_toolbar_set_style (tb, selection);
|
||||||
|
|
||||||
|
selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
|
||||||
|
// prefs has only small and large icons so add 2 to get right enum
|
||||||
|
if (gtk_toolbar_get_icon_size (tb) != selection + 2)
|
||||||
|
gtk_toolbar_set_icon_size (tb, selection + 2);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Based on code from Epiphany (src/ephy-window.c)
|
* Based on code from Epiphany (src/ephy-window.c)
|
||||||
*/
|
*/
|
||||||
@@ -3707,6 +3729,13 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
GNC_PREF_TAB_POSITION_RIGHT,
|
GNC_PREF_TAB_POSITION_RIGHT,
|
||||||
gnc_main_window_update_tab_position,
|
gnc_main_window_update_tab_position,
|
||||||
window);
|
window);
|
||||||
|
|
||||||
|
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
|
||||||
|
gnc_main_window_update_toolbar, window);
|
||||||
|
|
||||||
|
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
|
||||||
|
gnc_main_window_update_toolbar, window);
|
||||||
|
|
||||||
gnc_main_window_update_tab_position(NULL, NULL, window);
|
gnc_main_window_update_tab_position(NULL, NULL, window);
|
||||||
|
|
||||||
gnc_main_window_init_menu_updaters(window);
|
gnc_main_window_init_menu_updaters(window);
|
||||||
@@ -3839,6 +3868,13 @@ gnc_main_window_add_widget (GtkUIManager *merge,
|
|||||||
if (GTK_IS_TOOLBAR (widget))
|
if (GTK_IS_TOOLBAR (widget))
|
||||||
{
|
{
|
||||||
priv->toolbar = widget;
|
priv->toolbar = widget;
|
||||||
|
|
||||||
|
gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
|
||||||
|
gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
|
||||||
|
|
||||||
|
// prefs has only small and large icons so add 2 to get right enum
|
||||||
|
gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
|
||||||
|
(gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
|
||||||
|
|||||||
@@ -205,6 +205,16 @@
|
|||||||
<summary>Display the notebook tabs at the right of the window.</summary>
|
<summary>Display the notebook tabs at the right of the window.</summary>
|
||||||
<description>This setting determines the edge at which the tabs for switching pages in notebooks are drawn. Possible values are "top", "left", "bottom" and "right". It defaults to "top".</description>
|
<description>This setting determines the edge at which the tabs for switching pages in notebooks are drawn. Possible values are "top", "left", "bottom" and "right". It defaults to "top".</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="toolbar-style" type="i">
|
||||||
|
<default>3</default>
|
||||||
|
<summary>Toolbar Style choice</summary>
|
||||||
|
<description>This setting controls how the toolbar icons are displayed.</description>
|
||||||
|
</key>
|
||||||
|
<key name="toolbar-icon-size" type="i">
|
||||||
|
<default>1</default>
|
||||||
|
<summary>Toolbar Icon Size</summary>
|
||||||
|
<description>This setting controls the size of the toolbar icons.</description>
|
||||||
|
</key>
|
||||||
<key name="summarybar-position-top" type="b">
|
<key name="summarybar-position-top" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
<summary>Display the summary bar at the top of the page.</summary>
|
<summary>Display the summary bar at the top of the page.</summary>
|
||||||
@@ -336,7 +346,7 @@
|
|||||||
<description>This sets the number of characters before auto complete starts for description, notes and memo fields.</description>
|
<description>This sets the number of characters before auto complete starts for description, notes and memo fields.</description>
|
||||||
</key>
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
<schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">
|
<schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">
|
||||||
<key name="use-new-window" type="b">
|
<key name="use-new-window" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.20.2 -->
|
<!-- Generated with glade 3.20.4 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.10"/>
|
<requires lib="gtk+" version="3.10"/>
|
||||||
<object class="GtkAdjustment" id="auto_decimal_places_adj">
|
<object class="GtkAdjustment" id="auto_decimal_places_adj">
|
||||||
@@ -97,6 +97,40 @@
|
|||||||
<property name="step_increment">1</property>
|
<property name="step_increment">1</property>
|
||||||
<property name="page_increment">10</property>
|
<property name="page_increment">10</property>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkListStore" id="toolbar-icon-sizes">
|
||||||
|
<columns>
|
||||||
|
<!-- column-name sizes-text -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
</columns>
|
||||||
|
<data>
|
||||||
|
<row>
|
||||||
|
<col id="0" translatable="yes">Small Icons</col>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<col id="0" translatable="yes">Large Icons</col>
|
||||||
|
</row>
|
||||||
|
</data>
|
||||||
|
</object>
|
||||||
|
<object class="GtkListStore" id="toolbar-styles">
|
||||||
|
<columns>
|
||||||
|
<!-- column-name styles-text -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
</columns>
|
||||||
|
<data>
|
||||||
|
<row>
|
||||||
|
<col id="0" translatable="yes">Icons</col>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<col id="0" translatable="yes">Text</col>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<col id="0" translatable="yes">Icons and Text</col>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<col id="0" translatable="yes">Icons and Important Text</col>
|
||||||
|
</row>
|
||||||
|
</data>
|
||||||
|
</object>
|
||||||
<object class="GtkDialog" id="gnucash_preferences_dialog">
|
<object class="GtkDialog" id="gnucash_preferences_dialog">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="title" translatable="yes">GnuCash Preferences</property>
|
<property name="title" translatable="yes">GnuCash Preferences</property>
|
||||||
@@ -3221,6 +3255,114 @@ many months before the current month:</property>
|
|||||||
<property name="top_attach">6</property>
|
<property name="top_attach">6</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBox" id="pref/general/toolbar-icon-size">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="has_tooltip">True</property>
|
||||||
|
<property name="tooltip_markup">Specify the icon size for the toolbars.</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Specify the icon size for the toolbars.</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="margin_left">12</property>
|
||||||
|
<property name="model">toolbar-icon-sizes</property>
|
||||||
|
<property name="active">1</property>
|
||||||
|
<property name="id_column">0</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="toolbar-icon-renderer"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">0</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">15</property>
|
||||||
|
<property name="width">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBox" id="pref/general/toolbar-style">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="has_tooltip">True</property>
|
||||||
|
<property name="tooltip_markup">Change the way the toolbar items are displayed.</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Change the way the toolbar items are displayed.</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="margin_left">12</property>
|
||||||
|
<property name="model">toolbar-styles</property>
|
||||||
|
<property name="active">3</property>
|
||||||
|
<property name="id_column">0</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="toolbar-style-renderer"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">0</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">18</property>
|
||||||
|
<property name="width">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label22">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes"><b>Toolbar Icon Size</b></property>
|
||||||
|
<property name="use_markup">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">14</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label23">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="label" translatable="yes"><b>Toolbar Style</b></property>
|
||||||
|
<property name="use_markup">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">17</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label24">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">13</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label25">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">16</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
@@ -71,6 +71,8 @@
|
|||||||
#define GNC_PREF_DATE_BACKMONTHS "date-backmonths"
|
#define GNC_PREF_DATE_BACKMONTHS "date-backmonths"
|
||||||
#define GNC_PREF_SHOW_LEAF_ACCT_NAMES "show-leaf-account-names"
|
#define GNC_PREF_SHOW_LEAF_ACCT_NAMES "show-leaf-account-names"
|
||||||
#define GNC_PREF_ENTER_MOVES_TO_END "enter-moves-to-end"
|
#define GNC_PREF_ENTER_MOVES_TO_END "enter-moves-to-end"
|
||||||
|
#define GNC_PREF_TOOLBAR_STYLE "toolbar-style"
|
||||||
|
#define GNC_PREF_TOOLBAR_ICON_SIZE "toolbar-icon-size"
|
||||||
/* Register preferences */
|
/* Register preferences */
|
||||||
#define GNC_PREF_DRAW_HOR_LINES "draw-horizontal-lines"
|
#define GNC_PREF_DRAW_HOR_LINES "draw-horizontal-lines"
|
||||||
#define GNC_PREF_DRAW_VERT_LINES "draw-vertical-lines"
|
#define GNC_PREF_DRAW_VERT_LINES "draw-vertical-lines"
|
||||||
|
|||||||
Reference in New Issue
Block a user