[gnome-clocks/bilelmoussaoui/fonts] consistent remove button in world/alarms panels
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/bilelmoussaoui/fonts] consistent remove button in world/alarms panels
- Date: Thu, 6 Aug 2020 08:24:05 +0000 (UTC)
commit 2909f9dba0802bda5c73bd626b8b185c1a213136
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Thu Jul 16 13:27:15 2020 +0200
consistent remove button in world/alarms panels
fixes #82
data/css/gnome-clocks.css | 2 +-
data/ui/alarm-face.ui | 2 +-
data/ui/alarm-row.ui | 45 ++++-----------------------------------------
data/ui/world-row.ui | 1 -
src/alarm-face.vala | 5 +++++
src/alarm-row.vala | 5 -----
6 files changed, 11 insertions(+), 49 deletions(-)
---
diff --git a/data/css/gnome-clocks.css b/data/css/gnome-clocks.css
index 2473ac3..0aa1e90 100644
--- a/data/css/gnome-clocks.css
+++ b/data/css/gnome-clocks.css
@@ -22,7 +22,7 @@ label.destructive-action {
padding: 6px 32px;
}
-.pill-button {
+.pill-button, .round-button.flat:hover {
border-radius: 9999px;
-gtk-outline-radius: 9999px;
}
diff --git a/data/ui/alarm-face.ui b/data/ui/alarm-face.ui
index ab70543..22eb3cf 100644
--- a/data/ui/alarm-face.ui
+++ b/data/ui/alarm-face.ui
@@ -49,7 +49,7 @@
<property name="visible">True</property>
<property name="valign">start</property>
<property name="selection-mode">none</property>
- <property name="activate-on-single-click">False</property>
+ <property name="activate-on-single-click">True</property>
<style>
<class name="content"/>
<class name="clocks-list"/>
diff --git a/data/ui/alarm-row.ui b/data/ui/alarm-row.ui
index dfa45b9..9c1e633 100644
--- a/data/ui/alarm-row.ui
+++ b/data/ui/alarm-row.ui
@@ -5,7 +5,7 @@
<template class="ClocksAlarmRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="activatable">False</property>
+ <property name="activatable">True</property>
<property name="selectable">False</property>
<child>
<object class="GtkGrid">
@@ -31,52 +31,15 @@
<property name="height">3</property>
</packing>
</child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- <property name="height">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Edit</property>
- <property name="halign">end</property>
- <property name="valign">center</property>
- <signal name="clicked" handler="edit" swapped="no"/>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">1</property>
- <property name="icon_name">document-edit-symbolic</property>
- </object>
- </child>
- <style>
- <class name="circular"/>
- </style>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">0</property>
- <property name="height">3</property>
- </packing>
- </child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Delete</property>
- <property name="halign">end</property>
+ <property name="halign">center</property>
<property name="valign">center</property>
+ <property name="relief">none</property>
<signal name="clicked" handler="delete" swapped="no"/>
<child>
<object class="GtkImage">
@@ -86,7 +49,7 @@
</object>
</child>
<style>
- <class name="circular"/>
+ <class name="circular"/>
</style>
</object>
<packing>
diff --git a/data/ui/world-row.ui b/data/ui/world-row.ui
index 7e1abc1..6b07046 100644
--- a/data/ui/world-row.ui
+++ b/data/ui/world-row.ui
@@ -98,7 +98,6 @@
</child>
<style>
<class name="round-button"/>
- <class name="small-button"/>
</style>
</object>
</child>
diff --git a/src/alarm-face.vala b/src/alarm-face.vala
index 71719af..bf0d387 100644
--- a/src/alarm-face.vala
+++ b/src/alarm-face.vala
@@ -69,6 +69,11 @@ public class Face : Gtk.Stack, Clocks.Clock {
return new Row ((Item) item, this);
});
+ listbox.row_activated.connect ((row) => {
+ var alarm = ((Row) row).alarm;
+ this.edit (alarm);
+ });
+
load ();
alarms.items_changed.connect ((position, removed, added) => {
diff --git a/src/alarm-row.vala b/src/alarm-row.vala
index c82f81e..c30c6a5 100644
--- a/src/alarm-row.vala
+++ b/src/alarm-row.vala
@@ -97,11 +97,6 @@ private class Row : Gtk.ListBoxRow {
title.label = (string) label;
}
- [GtkCallback]
- private void edit () {
- face.edit (alarm);
- }
-
[GtkCallback]
private void delete () {
face.delete (alarm);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]