[gnome-break-timer/dylanmccall/lock-screen-option] Add an option to disable screen locking




commit 118f245606e180cf8e301755e7b196fef32aa94e
Author: Dylan McCall <dylan dylanmccall ca>
Date:   Wed Dec 16 10:05:40 2020 -0800

    Add an option to disable screen locking

 src/settings/BreakSettingsDialog.vala       | 7 +++++++
 src/settings/break/BreakSettingsWidget.vala | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/settings/BreakSettingsDialog.vala b/src/settings/BreakSettingsDialog.vala
index e43a0f7..45f7c89 100644
--- a/src/settings/BreakSettingsDialog.vala
+++ b/src/settings/BreakSettingsDialog.vala
@@ -72,10 +72,17 @@ public class BreakSettingsDialog : Gtk.Dialog {
         );
         settings.bind ("selected-breaks", this.configuration_chooser, "selected-break-ids", 
SettingsBindFlags.DEFAULT);
 
+        // TODO: Create a stack with a child for each configuration. Switch
+        //       between these instead of showing / hiding widgets.
+
         this.breaks_grid = new FixedSizeGrid ();
         content.add (this.breaks_grid);
         this.breaks_grid.set_orientation (Gtk.Orientation.VERTICAL);
 
+        var lock_toggle = new Gtk.CheckButton.with_label("Lock screen during breaks");
+        content.add(lock_toggle);
+        lock_toggle.show();
+
         content.show_all ();
 
         this.configuration_chooser.notify["selected-break-ids"].connect (this.update_break_configuration);
diff --git a/src/settings/break/BreakSettingsWidget.vala b/src/settings/break/BreakSettingsWidget.vala
index 25ca960..effebec 100644
--- a/src/settings/break/BreakSettingsWidget.vala
+++ b/src/settings/break/BreakSettingsWidget.vala
@@ -22,7 +22,7 @@ namespace BreakTimer.Settings.Break {
 
 public abstract class BreakSettingsWidget : Gtk.Grid {
     private Gtk.Grid header;
-    private Gtk.Grid details;
+    private Gtk.Box details;
 
     protected BreakSettingsWidget (BreakType break_type, string title, string? description) {
         GLib.Object ();
@@ -54,7 +54,7 @@ public abstract class BreakSettingsWidget : Gtk.Grid {
         // description_label.set_hexpand (true);
         // description_label.set_justify (Gtk.Justification.CENTER);
 
-        this.details = new Gtk.Grid ();
+        this.details = new Gtk.Box (Gtk.Orientation.VERTICAL, 10);
         this.add (this.details);
         this.details.set_margin_start (12);
         this.details.set_halign (Gtk.Align.CENTER);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]