[gnome-boxes] editable-entry: Drop usage of deprecated Gtk.Alignment
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] editable-entry: Drop usage of deprecated Gtk.Alignment
- Date: Mon, 30 Jun 2014 18:05:46 +0000 (UTC)
commit dff8b7847acb4db5b008ed650d3b896530ec283b
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Jun 30 17:46:18 2014 +0100
editable-entry: Drop usage of deprecated Gtk.Alignment
data/ui/editable-entry.ui | 68 ++++++++++++++++++++------------------------
src/editable-entry.vala | 12 +++----
2 files changed, 36 insertions(+), 44 deletions(-)
---
diff --git a/data/ui/editable-entry.ui b/data/ui/editable-entry.ui
index afda77a..0681629 100644
--- a/data/ui/editable-entry.ui
+++ b/data/ui/editable-entry.ui
@@ -1,54 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.9 -->
- <template class="BoxesEditableEntry" parent="GtkAlignment">
+ <template class="BoxesEditableEntry" parent="GtkNotebook">
<property name="visible">True</property>
+ <property name="show-tabs">False</property>
+ <property name="show-border">False</property>
+ <property name="page">0</property>
<child>
- <object class="GtkNotebook" id="notebook">
+ <object class="GtkLabel" id="label">
<property name="visible">True</property>
- <property name="show-tabs">False</property>
- <property name="show-border">False</property>
- <property name="page">0</property>
+ <property name="ellipsize">end</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ </object>
+ </child>
- <child>
- <object class="GtkLabel" id="label">
- <property name="visible">True</property>
- <property name="ellipsize">end</property>
- <property name="halign">start</property>
- <property name="valign">center</property>
- </object>
- </child>
+ <child>
+ <object class="GtkButton" id="button">
+ <property name="visible">True</property>
+ <property name="receives_default">True</property>
+ <property name="relief">none</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="on_button_clicked"/>
<child>
- <object class="GtkButton" id="button">
+ <object class="GtkLabel" id="button_label">
<property name="visible">True</property>
- <property name="receives_default">True</property>
- <property name="relief">none</property>
- <property name="halign">start</property>
- <property name="valign">center</property>
- <signal name="clicked" handler="on_button_clicked"/>
-
- <child>
- <object class="GtkLabel" id="button_label">
- <property name="visible">True</property>
- <property name="ellipsize">end</property>
- <signal name="size-allocate"
- handler="on_button_label_size_allocate"/>
- </object>
- </child>
+ <property name="ellipsize">end</property>
+ <signal name="size-allocate"
+ handler="on_button_label_size_allocate"/>
</object>
</child>
+ </object>
+ </child>
- <child>
- <object class="GtkEntry" id="entry">
- <property name="visible">True</property>
- <signal name="activate" handler="on_entry_activated"/>
- <signal name="focus-out-event" handler="on_entry_focused_out"/>
- <signal name="key-press-event" handler="on_entry_key_press_event"/>
- <signal name="style-updated" handler="on_entry_style_updated"/>
- </object>
- </child>
+ <child>
+ <object class="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <signal name="activate" handler="on_entry_activated"/>
+ <signal name="focus-out-event" handler="on_entry_focused_out"/>
+ <signal name="key-press-event" handler="on_entry_key_press_event"/>
+ <signal name="style-updated" handler="on_entry_style_updated"/>
</object>
</child>
diff --git a/src/editable-entry.vala b/src/editable-entry.vala
index bb70a0c..8e02791 100644
--- a/src/editable-entry.vala
+++ b/src/editable-entry.vala
@@ -6,7 +6,7 @@ using Gtk;
private const string EMPTY_TEXT = "\xe2\x80\x94";
[GtkTemplate (ui = "/org/gnome/Boxes/ui/editable-entry.ui")]
-private class Boxes.EditableEntry: Alignment {
+private class Boxes.EditableEntry: Notebook {
private enum Page {
LABEL,
BUTTON,
@@ -38,7 +38,7 @@ private class Boxes.EditableEntry: Alignment {
return;
_editable = value;
- notebook.page = editable ? Page.BUTTON : Page.LABEL;
+ page = editable ? Page.BUTTON : Page.LABEL;
}
}
@@ -88,8 +88,6 @@ private class Boxes.EditableEntry: Alignment {
public bool scale_set { get; set; }
[GtkChild]
- private Gtk.Notebook notebook;
- [GtkChild]
private Gtk.Label label;
[GtkChild]
private Gtk.Label button_label;
@@ -127,7 +125,7 @@ private class Boxes.EditableEntry: Alignment {
}
public void start_editing () {
- notebook.page = Page.ENTRY;
+ page = Page.ENTRY;
}
private bool in_stop_editing;
@@ -138,7 +136,7 @@ private class Boxes.EditableEntry: Alignment {
return;
in_stop_editing = true;
- notebook.page = Page.BUTTON;
+ page = Page.BUTTON;
text = entry.text;
editing_done ();
in_stop_editing = false;
@@ -146,7 +144,7 @@ private class Boxes.EditableEntry: Alignment {
private void cancel_editing () {
entry.text = text;
- notebook.page = Page.BUTTON;
+ page = Page.BUTTON;
}
public EditableEntry () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]