diff --git a/demo/GraniteDemo.vala b/demo/GraniteDemo.vala index bbaf4a510..9e4d8d305 100644 --- a/demo/GraniteDemo.vala +++ b/demo/GraniteDemo.vala @@ -24,7 +24,6 @@ public class Granite.Demo : Gtk.Application { var hypertext_view = new HyperTextViewGrid (); var mode_button_view = new ModeButtonView (); var overlaybar_view = new OverlayBarView (); - var settings_view = new SettingsView (); var toast_view = new ToastView (); var settings_uris_view = new SettingsUrisView (); var utils_view = new UtilsView (); @@ -41,7 +40,6 @@ public class Granite.Demo : Gtk.Application { main_stack.add_titled (hypertext_view, "hypertextview", "HyperTextView"); main_stack.add_titled (mode_button_view, "selection_controls", "Selection Controls"); main_stack.add_titled (overlaybar_view, "overlaybar", "OverlayBar"); - main_stack.add_titled (settings_view, "settings", "SettingsSidebar"); main_stack.add_titled (settings_uris_view, "settings_uris", "Settings URIs"); main_stack.add_titled (toast_view, "toasts", "Toast"); main_stack.add_titled (utils_view, "utils", "Utils"); diff --git a/demo/Views/SettingsView/SettingsPage.vala b/demo/Views/SettingsView/SettingsPage.vala deleted file mode 100644 index 2ebce6126..000000000 --- a/demo/Views/SettingsView/SettingsPage.vala +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2017-2021 elementary, Inc. (https://elementary.io) - * SPDX-License-Identifier: LGPL-3.0-or-later - */ - -public class SettingsPage : Granite.SettingsPage { - public SettingsPage () { - var display_widget = new Gtk.Spinner () { - height_request = 32 - }; - display_widget.start (); - - Object ( - display_widget: display_widget, - status: "Spinning", - header: "Manual Pages", - title: "Custom Display Widget Page" - ); - } - - construct { - var title_label = new Gtk.Label ("Title:") { - xalign = 1 - }; - - var title_entry = new Gtk.Entry () { - hexpand = true, - placeholder_text = "This page's title" - }; - - var content_area = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12) { - margin_start = 12, - margin_end = 12, - margin_top = 12, - margin_bottom = 12, - valign = Gtk.Align.START - }; - - content_area.append (title_label); - content_area.append (title_entry); - - child = content_area; - - title_entry.changed.connect (() => { - title = title_entry.text; - }); - } -} diff --git a/demo/Views/SettingsView/SettingsView.vala b/demo/Views/SettingsView/SettingsView.vala deleted file mode 100644 index d91c90cd5..000000000 --- a/demo/Views/SettingsView/SettingsView.vala +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2017-2021 elementary, Inc. (https://elementary.io) - * SPDX-License-Identifier: LGPL-3.0-or-later - */ - -public class SettingsView : Gtk.Box { - construct { - var settings_page = new SimpleSettingsPage (); - - var settings_page_two = new SettingsPage (); - - var stack = new Gtk.Stack (); - stack.add_named (settings_page, "settings_page"); - stack.add_named (settings_page_two, "settings_page_two"); - - var settings_sidebar = new Granite.SettingsSidebar (stack); - - var paned = new Gtk.Paned (Gtk.Orientation.HORIZONTAL) { - start_child = settings_sidebar, - end_child = stack, - resize_start_child = false, - shrink_end_child = false, - shrink_start_child = false - }; - - append (paned); - } -} diff --git a/demo/Views/SettingsView/SimpleSettingsPage.vala b/demo/Views/SettingsView/SimpleSettingsPage.vala deleted file mode 100644 index 3bb179c4a..000000000 --- a/demo/Views/SettingsView/SimpleSettingsPage.vala +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2017-2021 elementary, Inc. (https://elementary.io) - * SPDX-License-Identifier: LGPL-3.0-or-later - */ - -public class SimpleSettingsPage : Granite.SimpleSettingsPage { - public SimpleSettingsPage () { - Object ( - activatable: true, - description: "This is a demo of Granite's SimpleSettingsPage", - header: "Simple Pages", - icon_name: "preferences-system", - title: "First Test Page" - ); - } - - construct { - var icon_label = new Gtk.Label ("Icon Name:"); - icon_label.xalign = 1; - - var icon_entry = new Gtk.Entry (); - icon_entry.hexpand = true; - icon_entry.placeholder_text = "This page's icon name"; - icon_entry.text = icon_name; - - var title_label = new Gtk.Label ("Title:"); - title_label.xalign = 1; - - var title_entry = new Gtk.Entry (); - title_entry.hexpand = true; - title_entry.placeholder_text = "This page's title"; - - var description_label = new Gtk.Label ("Description:"); - description_label.xalign = 1; - - var description_entry = new Gtk.Entry (); - description_entry.hexpand = true; - description_entry.placeholder_text = "This page's description"; - - content_area.attach (icon_label, 0, 0, 1, 1); - content_area.attach (icon_entry, 1, 0, 1, 1); - content_area.attach (title_label, 0, 1, 1, 1); - content_area.attach (title_entry, 1, 1, 1, 1); - content_area.attach (description_label, 0, 2, 1, 1); - content_area.attach (description_entry, 1, 2, 1, 1); - - var button = new Gtk.Button.with_label ("Test Button"); - - update_status (); - - description_entry.changed.connect (() => { - description = description_entry.text; - }); - - icon_entry.changed.connect (() => { - icon_name = icon_entry.text; - }); - - status_switch.notify["active"].connect (update_status); - - title_entry.changed.connect (() => { - title = title_entry.text; - }); - - action_area.append (button); - } - - private void update_status () { - if (status_switch.active) { - status_type = Granite.SettingsPage.StatusType.SUCCESS; - status = _("Enabled"); - } else { - status_type = Granite.SettingsPage.StatusType.OFFLINE; - status = _("Disabled"); - } - } -} diff --git a/demo/meson.build b/demo/meson.build index 877e5eb04..744f89193 100644 --- a/demo/meson.build +++ b/demo/meson.build @@ -13,9 +13,6 @@ executable( 'Views/ModeButtonView.vala', 'Views/OverlayBarView.vala', 'Views/SettingsUrisView.vala', - 'Views/SettingsView/SettingsPage.vala', - 'Views/SettingsView/SettingsView.vala', - 'Views/SettingsView/SimpleSettingsPage.vala', 'Views/ToastView.vala', 'Views/UtilsView.vala', 'Views/WelcomeView.vala',