Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle own titlebuttons #63

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y libgranite-7-dev libgtk-4-dev libswitchboard-3-dev libwacom-dev libgudev-1.0-dev libx11-dev libxi-dev meson valac
apt install -y libadwaita-1-dev libgranite-7-dev libgtk-4-dev libswitchboard-3-dev libwacom-dev libgudev-1.0-dev libx11-dev libxi-dev meson valac
- name: Build
env:
DESTDIR: out
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

You'll need the following dependencies:

* libadwaita-1-dev
* libswitchboard-3-dev
* libgranite-7-dev
* libwacom-dev
Expand Down
20 changes: 16 additions & 4 deletions src/Plug.vala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

public class Wacom.Plug : Switchboard.Plug {
private MainPage main_page;
private Gtk.Box box;

public Plug () {
GLib.Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Expand All @@ -26,11 +26,23 @@ public class Wacom.Plug : Switchboard.Plug {
}

public override Gtk.Widget get_widget () {
if (main_page == null) {
main_page = new MainPage ();
if (box == null) {
var headerbar = new Adw.HeaderBar () {
show_title = false
};
headerbar.add_css_class (Granite.STYLE_CLASS_FLAT);

var main_page = new MainPage () {
vexpand = true
};

box = new Gtk.Box (VERTICAL, 0);
box.append (headerbar);
box.append (main_page);

}

return main_page;
return box;
}

public override void shown () {
Expand Down
1 change: 1 addition & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ shared_module(
dependency('gobject-2.0'),
dependency('granite-7'),
dependency('gtk4'),
dependency('libadwaita-1'),
dependency('libwacom'),
dependency('gudev-1.0'),
dependency('x11'),
Expand Down
Loading