summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-06-01 12:18:13 +0200
committerraveit65 <[email protected]>2018-06-03 08:58:05 +0200
commit58f106ab043c6d1b0199bb8a0f8552deb32e12ef (patch)
tree72f9f5d52da1486668e584c17d2df3ad070b09aa
parent074773ba71ac5a2536a5791f646ff0f7af4cdd43 (diff)
downloadmate-calc-58f106ab043c6d1b0199bb8a0f8552deb32e12ef.tar.bz2
mate-calc-58f106ab043c6d1b0199bb8a0f8552deb32e12ef.tar.xz
UI: avoid deprecated GtkButton:use-stock
-rw-r--r--data/buttons-financial.ui40
-rw-r--r--data/buttons-programming.ui10
-rw-r--r--data/preferences.ui10
-rw-r--r--src/math-buttons.c13
4 files changed, 49 insertions, 24 deletions
diff --git a/data/buttons-financial.ui b/data/buttons-financial.ui
index d9cc787..45d490c 100644
--- a/data/buttons-financial.ui
+++ b/data/buttons-financial.ui
@@ -24,12 +24,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button1">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -206,12 +206,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button3">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -388,12 +388,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button5">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -570,12 +570,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button19">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -722,12 +722,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button7">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -905,12 +905,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button9">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1088,12 +1088,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button11">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1271,12 +1271,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button13">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1454,12 +1454,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button15">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1666,12 +1666,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button17">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_stock">True</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/data/buttons-programming.ui b/data/buttons-programming.ui
index c596b51..5893886 100644
--- a/data/buttons-programming.ui
+++ b/data/buttons-programming.ui
@@ -2,6 +2,11 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.22"/>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">process-stop</property>
+ </object>
<object class="GtkDialog" id="character_code_dialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -25,12 +30,13 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button8">
- <property name="label">gtk-cancel</property>
+ <property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
- <property name="use_stock">True</property>
+ <property name="image">image1</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/data/preferences.ui b/data/preferences.ui
index cd9581d..758c67b 100644
--- a/data/preferences.ui
+++ b/data/preferences.ui
@@ -15,6 +15,11 @@
<property name="step_increment">1</property>
<property name="page_increment">1</property>
</object>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">window-close</property>
+ </object>
<object class="GtkListStore" id="number_format_model">
<columns>
<!-- column-name label -->
@@ -72,11 +77,12 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button1">
- <property name="label">gtk-close</property>
+ <property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_stock">True</property>
+ <property name="image">image1</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/math-buttons.c b/src/math-buttons.c
index 42191ef..69aad47 100644
--- a/src/math-buttons.c
+++ b/src/math-buttons.c
@@ -584,6 +584,19 @@ load_mode(MathButtons *buttons, ButtonMode mode)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
}
+ /* put the icon name "process-stop" in the buttons
+ button1, button3, button5, button7, button9,
+ button11, button13, button15, button17, button19
+ taken from buttons-financial.ui */
+ for (i = 1; i < 20; i++) {
+ if (i % 2) {
+ widget = GET_WIDGET (builder, g_strdup_printf ("button%d",i));
+ if (GTK_IS_BUTTON(widget))
+ gtk_button_set_image (GTK_BUTTON (widget),
+ gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON));
+ }
+ }
+
if (mode == PROGRAMMING) {
GtkListStore *model;
GtkTreeIter iter;