Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions src/Widgets/VariantWidget.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2017-2023 elementary, Inc. (https://elementary.io)
* SPDX-FileCopyrightText: 2017-2026 elementary, Inc. (https://elementary.io)
*/

public class VariantWidget : Gtk.Frame {
Expand All @@ -11,7 +11,6 @@ public class VariantWidget : Gtk.Frame {

public signal void going_to_main ();

private Gtk.Box variant_box;
private Adw.NavigationView navigation_view;
private Adw.NavigationPage variant_page;

Expand All @@ -29,47 +28,43 @@ public class VariantWidget : Gtk.Frame {

var main_page = new Adw.NavigationPage (main_scrolled, main_title);

variant_listbox = new Gtk.ListBox ();
variant_listbox.activate_on_single_click = false;
variant_listbox = new Gtk.ListBox () {
activate_on_single_click = false
};

var variant_scrolled = new Gtk.ScrolledWindow () {
child = variant_listbox,
hscrollbar_policy = NEVER,
vexpand = true
};

var back_button = new Gtk.Button.with_label (main_page.title) {
halign = START,
margin_top = 6,
margin_end = 6,
margin_bottom = 6,
margin_start = 6
var back_button = new Granite.BackButton (main_page.title) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicking the Input Language button now get you back to the language selection instead of all keyboard layouts.

halign = START
};
back_button.add_css_class (Granite.STYLE_CLASS_BACK_BUTTON);

var variant_title = new Gtk.Label ("") {
hexpand = true,
justify = CENTER,
margin_end = 6,
margin_start = 6,
mnemonic_widget = variant_listbox,
wrap = true
};
variant_title.add_css_class (Granite.STYLE_CLASS_H4_LABEL);

var header_box = new Gtk.CenterBox () {
start_widget = back_button,
center_widget = variant_title,
hexpand = true
var header_box = new Gtk.HeaderBar () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can now perform secondary click to show the window context menu here, meaning you can close Initial Setup before finishing (not 100% sure because I tested this in the desktop session, not in Greeter).

Image

hexpand = true,
show_title_buttons = false,
title_widget = variant_title
};
header_box.pack_start (back_button);

variant_box = new Gtk.Box (VERTICAL, 0);
variant_box.add_css_class (Granite.STYLE_CLASS_VIEW);
variant_box.append (header_box);
variant_box.append (new Gtk.Separator (HORIZONTAL));
variant_box.append (variant_scrolled);
var toolbarview = new Adw.ToolbarView () {
content = variant_scrolled,
top_bar_style = RAISED_BORDER
};
toolbarview.add_top_bar (header_box);
toolbarview.add_css_class (Granite.STYLE_CLASS_VIEW);

variant_page = new Adw.NavigationPage (variant_box, "");
variant_page = new Adw.NavigationPage (toolbarview, "");

navigation_view = new Adw.NavigationView ();
navigation_view.add (main_page);
Expand Down