[gnome-clocks/zbrown/list-alarms: 7/25] alarm: Highly broken initial list
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/zbrown/list-alarms: 7/25] alarm: Highly broken initial list
- Date: Sun, 23 Feb 2020 17:11:14 +0000 (UTC)
commit 62cf47fa9ff9849528034172a42e3dd093c48736
Author: Zander Brown <zbrown gnome org>
Date: Sun Jul 28 20:34:57 2019 +0100
alarm: Highly broken initial list
data/ui/alarm.ui | 17 +++++++++++++----
src/alarm.vala | 20 ++++++++++++--------
2 files changed, 25 insertions(+), 12 deletions(-)
---
diff --git a/data/ui/alarm.ui b/data/ui/alarm.ui
index 6ead5a3..0e5eac2 100644
--- a/data/ui/alarm.ui
+++ b/data/ui/alarm.ui
@@ -5,7 +5,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">False</property>
- <property name="n-selected" bind-source="content_view" bind-property="n-selected"
bind-flags="sync-create" />
<signal name="notify::visible-child" handler="visible_child_changed" swapped="no"/>
<child>
<object class="GtkGrid" id="empty_view">
@@ -45,10 +44,20 @@
</object>
</child>
<child>
- <object class="ClocksContentView" id="content_view">
+ <object class="GtkScrolledWindow" id="list_view">
<property name="visible">True</property>
- <property name="mode" bind-source="ClocksAlarmFace" bind-property="view-mode"
bind-flags="sync-create|bidirectional" />
- <signal name="item-activated" handler="item_activated" swapped="no"/>
+ <child>
+ <object class="HdyColumn">
+ <property name="visible">True</property>
+ <property name="maximum-width">500</property>
+ <child>
+ <object class="GtkListBox" id="listbox">
+ <property name="visible">True</property>
+ <!--<signal name="row-activated" handler="item_activated" swapped="no"/>-->
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
<child>
diff --git a/src/alarm.vala b/src/alarm.vala
index 3162c54..06a9b0c 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -596,8 +596,12 @@ public class Face : Gtk.Stack, Clocks.Clock {
private GLib.Settings settings;
[GtkChild]
private Gtk.Widget empty_view;
+ //[GtkChild]
+ //private ContentView content_view;
[GtkChild]
- private ContentView content_view;
+ private Gtk.ListBox listbox;
+ [GtkChild]
+ private Gtk.ScrolledWindow list_view;
[GtkChild]
private RingingPanel ringing_panel;
@@ -628,7 +632,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
}
});
- content_view.bind_model (alarms, (item) => {
+ listbox.bind_model (alarms, (item) => {
return new Tile ((Item)item);
});
@@ -660,7 +664,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
public signal void ring ();
- [GtkCallback]
+ //[GtkCallback]
private void item_activated (ContentItem item) {
Item alarm = (Item) item;
if (alarm.state == Item.State.SNOOZING) {
@@ -679,7 +683,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
[GtkCallback]
private void visible_child_changed () {
- if (visible_child == empty_view || visible_child == content_view) {
+ if (visible_child == empty_view || visible_child == list_view) {
view_mode = NORMAL;
} else if (visible_child == ringing_panel) {
view_mode = STANDALONE;
@@ -723,7 +727,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
}
private void reset_view () {
- visible_child = alarms.get_n_items () == 0 ? empty_view : content_view;
+ visible_child = alarms.get_n_items () == 0 ? empty_view : list_view;
}
public void activate_new () {
@@ -749,15 +753,15 @@ public class Face : Gtk.Stack, Clocks.Clock {
}
public void activate_select_all () {
- content_view.select_all ();
+ // content_view.select_all ();
}
public void activate_select_none () {
- content_view.unselect_all ();
+ // content_view.unselect_all ();
}
public bool escape_pressed () {
- return content_view.escape_pressed ();
+ return /*content_view.escape_pressed ();*/ false;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]