Skip to content
Snippets Groups Projects
Verified Commit a835727f authored by Bruce Cowan's avatar Bruce Cowan :airplane:
Browse files

Use Adwaita classes where possible

parent e5a577dc
No related branches found
No related tags found
No related merge requests found
Pipeline #3524 passed
......@@ -5,51 +5,49 @@
using Gtk 4.0;
using Adw 1;
template RugbyAppWindow : ApplicationWindow {
template RugbyAppWindow : Adw.ApplicationWindow {
title: "Rugby";
default-height: 600;
default-width: 400;
[titlebar]
HeaderBar {
SpinButton scorespin {
adjustment: Adjustment {
step-increment: 1;
upper: 200;
};
focusable: true;
tooltip-text: "Score";
}
Box {
orientation: vertical;
[title]
Label {
styles ["title"]
Adw.HeaderBar {
SpinButton scorespin {
adjustment: Adjustment {
step-increment: 1;
upper: 200;
};
focusable: true;
tooltip-text: "Score";
}
label: "Rugby";
[end]
MenuButton menu_button {
direction: none;
menu-model: app_menu;
}
}
[end]
MenuButton menu_button {
direction: none;
menu-model: app_menu;
}
}
ScrolledWindow {
vexpand: true;
ScrolledWindow {
Adw.ClampScrollable {
maximum-size: 600;
Adw.ClampScrollable {
maximum-size: 600;
ListView listview {
styles ["rich-list"]
ListView listview {
styles ["rich-list"]
model: NoSelection {
model: .RugbyListStore {
score: bind scorespin.value;
model: NoSelection {
model: .RugbyListStore {
score: bind scorespin.value;
};
};
};
factory: BuilderListItemFactory {
resource: "/uk/me/bcowan/rugby/score-item.ui";
};
factory: BuilderListItemFactory {
resource: "/uk/me/bcowan/rugby/score-item.ui";
};
}
}
}
}
......@@ -63,3 +61,4 @@ menu app_menu {
item ("_About Rugby", "app.about")
}
}
/*
* SPDX-FileCopyrightText: 2017-2021 Bruce Cowan <bruce@bcowan.me.uk>
* SPDX-FileCopyrightText: 2017-2022 Bruce Cowan <bruce@bcowan.me.uk>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
......@@ -14,10 +14,10 @@
struct _RugbyAppWindow
{
GtkApplicationWindow parent;
AdwApplicationWindow parent;
};
G_DEFINE_TYPE (RugbyAppWindow, rugby_app_window, GTK_TYPE_APPLICATION_WINDOW)
G_DEFINE_TYPE (RugbyAppWindow, rugby_app_window, ADW_TYPE_APPLICATION_WINDOW)
static char *
item_tooltip_cb (GtkListItem *item)
......
/*
* SPDX-FileCopyrightText: 2017 Bruce Cowan <bruce@bcowan.me.uk>
* SPDX-FileCopyrightText: 2017-2022 Bruce Cowan <bruce@bcowan.me.uk>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
#include <adwaita.h>
G_BEGIN_DECLS
#define RUGBY_TYPE_APP_WINDOW (rugby_app_window_get_type())
G_DECLARE_FINAL_TYPE (RugbyAppWindow, rugby_app_window, RUGBY, APP_WINDOW, GtkApplicationWindow)
G_DECLARE_FINAL_TYPE (RugbyAppWindow, rugby_app_window, RUGBY, APP_WINDOW, AdwApplicationWindow)
RugbyAppWindow * rugby_app_window_new (GtkApplication *app);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment