Add new preference to show tree view grid lines

This commit is contained in:
Robert Fewell 2017-07-02 09:47:21 +01:00
parent 6fbfb82220
commit 6f27ad1ba0
4 changed files with 147 additions and 28 deletions

View File

@ -224,6 +224,14 @@ gnc_window_adjust_for_screen(GtkWindow * window)
gtk_widget_queue_resize(GTK_WIDGET(window));
}
/********************************************************************\
* Sets the alignament of a Label Widget, GTK3 version specific. *
* *
* Args: widget - the label widget to set alignment on *
* xalign - x alignment *
* yalign - y alignment *
* Returns: nothing *
\********************************************************************/
void
gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign)
{
@ -235,6 +243,33 @@ gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign)
#endif
}
/********************************************************************\
* Get the preference for showing tree view grid lines *
* *
* Args: none *
* Returns: GtkTreeViewGridLines setting *
\********************************************************************/
GtkTreeViewGridLines
gnc_tree_view_get_grid_lines_pref (void)
{
GtkTreeViewGridLines grid_lines;
gboolean h_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, "grid-lines-horizontal");
gboolean v_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, "grid-lines-vertical");
if (h_lines)
{
if (v_lines)
grid_lines = GTK_TREE_VIEW_GRID_LINES_BOTH;
else
grid_lines = GTK_TREE_VIEW_GRID_LINES_HORIZONTAL;
}
else if (v_lines)
grid_lines = GTK_TREE_VIEW_GRID_LINES_VERTICAL;
else
grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE;
return grid_lines;
}
gboolean
gnc_handle_date_accelerator (GdkEventKey *event,
struct tm *tm,

View File

@ -61,9 +61,24 @@ void gnc_save_window_size (const char *section, GtkWindow *window);
\********************************************************************/
void gnc_window_adjust_for_screen (GtkWindow * window);
/********************************************************************\
* Sets the alignament of a Label Widget, GTK3 version specific. *
* *
* Args: widget - the label widget to set alignment on *
* xalign - x alignment *
* yalign - y alignment *
* Returns: nothing *
\********************************************************************/
void gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign);
/********************************************************************\
* Get the preference for showing tree view grid lines *
* *
* Args: none *
* Returns: GtkTreeViewGridLines setting *
\********************************************************************/
GtkTreeViewGridLines gnc_tree_view_get_grid_lines_pref (void);
gboolean gnc_handle_date_accelerator (GdkEventKey *event,
struct tm *tm,
const char *date_str);

View File

@ -1225,7 +1225,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">20</property>
<property name="top_attach">23</property>
</packing>
</child>
<child>
@ -1240,7 +1240,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">18</property>
<property name="top_attach">21</property>
</packing>
</child>
<child>
@ -1259,7 +1259,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">12</property>
<property name="top_attach">15</property>
</packing>
</child>
<child>
@ -1272,7 +1272,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
<property name="top_attach">14</property>
</packing>
</child>
<child>
@ -1282,7 +1282,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">10</property>
<property name="top_attach">13</property>
</packing>
</child>
<child>
@ -1297,7 +1297,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="top_attach">12</property>
</packing>
</child>
<child>
@ -1315,7 +1315,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
<property name="top_attach">12</property>
</packing>
</child>
<child>
@ -1334,7 +1334,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="top_attach">11</property>
</packing>
</child>
<child>
@ -1353,7 +1353,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
@ -1366,7 +1366,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
@ -1376,7 +1376,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
@ -1389,7 +1389,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">25</property>
<property name="top_attach">28</property>
</packing>
</child>
<child>
@ -1404,7 +1404,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">26</property>
<property name="top_attach">29</property>
</packing>
</child>
<child>
@ -1422,7 +1422,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">26</property>
<property name="top_attach">29</property>
</packing>
</child>
<child>
@ -1456,7 +1456,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">14</property>
<property name="top_attach">17</property>
</packing>
</child>
<child>
@ -1498,7 +1498,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">14</property>
<property name="top_attach">17</property>
</packing>
</child>
<child>
@ -1517,7 +1517,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">13</property>
<property name="top_attach">16</property>
</packing>
</child>
<child>
@ -1527,7 +1527,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">17</property>
<property name="top_attach">20</property>
</packing>
</child>
<child>
@ -1546,7 +1546,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">19</property>
<property name="top_attach">22</property>
</packing>
</child>
<child>
@ -1565,7 +1565,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">20</property>
<property name="top_attach">23</property>
</packing>
</child>
<child>
@ -1584,7 +1584,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">21</property>
<property name="top_attach">24</property>
</packing>
</child>
<child>
@ -1601,7 +1601,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">15</property>
<property name="top_attach">18</property>
</packing>
</child>
<child>
@ -1616,7 +1616,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">16</property>
<property name="top_attach">19</property>
</packing>
</child>
<child>
@ -1656,7 +1656,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">16</property>
<property name="top_attach">19</property>
</packing>
</child>
<child>
@ -1666,7 +1666,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">22</property>
<property name="top_attach">25</property>
</packing>
</child>
<child>
@ -1680,7 +1680,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">23</property>
<property name="top_attach">26</property>
</packing>
</child>
<child>
@ -1716,7 +1716,61 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">23</property>
<property name="top_attach">26</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pref/general/buttons-with-icons-and-labels">
<property name="label" translatable="yes">Enable icons on buttons which have been configured</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Some buttons have been defined to show an icon and a label. With this setting the display of the icon can be enabled or disabled.</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pref/general/grid-lines-horizontal">
<property name="label" translatable="yes">Enable horizontal grid lines on table displays</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable horizontal grid lines on table displays. These will mainly be tree views like the Accounts page.</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pref/general/grid-lines-vertical">
<property name="label" translatable="yes">Enable vertical grid lines on table displays</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable vertical grid lines on table displays. These will mainly be tree views like the Accounts page.</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="width">2</property>
</packing>
</child>
<child>

View File

@ -125,6 +125,11 @@
<summary>Width of notebook tabs</summary>
<description>This key specifies the maximum width of notebook tabs. If the text in the tab is longer than this value (the test is approximate) then the tab label will have the middle cut and replaced with an ellipsis.</description>
</key>
<key name="buttons-with-icons-and-labels" type="b">
<default>true</default>
<summary>Show Button Icons and Labels</summary>
<description>If active, buttons that have been configured to show icons and labels will show both. Otherwise only labels will be used.</description>
</key>
<key name="currency-choice-locale" type="b">
<default>true</default>
<summary>Use the system locale currency for all newly created accounts.</summary>
@ -165,6 +170,16 @@
<summary>Maximum number of months to go back.</summary>
<description>Dates will be completed so that they are close to the current date. Enter the maximum number of months to go backwards in time when completing dates.</description>
</key>
<key name="grid-lines-horizontal" type="b">
<default>false</default>
<summary>Show Horizontal Grid Lines</summary>
<description>If active, horzontal grid lines will be shown on table displays. Otherwise no horizontal grid lines will be shown.</description>
</key>
<key name="grid-lines-vertical" type="b">
<default>false</default>
<summary>Show Vertical Grid Lines</summary>
<description>If active, vertical grid lines will be shown on table displays. Otherwise no vertical grid lines will be shown.</description>
</key>
<key name="show-splash-screen" type="b">
<default>true</default>
<summary>Show splash screen</summary>