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

Use new Adwaita widgets

parent 2c102f97
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,9 @@ using Adw 1;
template $RugbyAppWindow : Adw.ApplicationWindow {
title: "Rugby";
Box {
orientation: vertical;
Adw.ToolbarView {
[top]
Adw.HeaderBar {
SpinButton scorespin {
adjustment: Adjustment {
......@@ -36,66 +36,70 @@ template $RugbyAppWindow : Adw.ApplicationWindow {
}
}
Revealer {
halign: center;
margin-top: 6;
reveal-child: bind filter_toggle.active;
transition-type: slide_down;
SpinButton tryspin {
adjustment: Adjustment {
step-increment: 1;
lower: 0;
upper: 40;
};
focusable: true;
tooltip-text: "Tries";
value-changed => $try_spin_value_changed_cb();
content: Box {
orientation: vertical;
Revealer {
halign: center;
margin-top: 6;
reveal-child: bind filter_toggle.active;
transition-type: slide_down;
SpinButton tryspin {
adjustment: Adjustment {
step-increment: 1;
lower: 0;
upper: 40;
};
focusable: true;
tooltip-text: "Tries";
value-changed => $try_spin_value_changed_cb();
}
}
}
Stack stack {
StackPage {
name: "empty_page";
Stack stack {
StackPage {
name: "empty_page";
child: Adw.StatusPage {
icon-name: "list";
title: "No possibilities";
};
}
child: Adw.StatusPage {
icon-name: "list";
title: "No possibilities";
};
}
StackPage {
name: "list_page";
StackPage {
name: "list_page";
child: ScrolledWindow {
vexpand: true;
child: ScrolledWindow {
vexpand: true;
Adw.Clamp {
maximum-size: 600;
tightening-threshold: 400;
Adw.Clamp {
maximum-size: 600;
tightening-threshold: 400;
ListView listview {
styles ["rich-list", "card"]
ListView listview {
styles ["rich-list", "card"]
factory: BuilderListItemFactory {
resource: "/uk/me/bcowan/Rugby/gtk/score-item.ui";
};
model: NoSelection {
model: FilterListModel {
filter: CustomFilter try_filter {};
model: $RugbyListStore list_store {
score: bind scorespin.value;
factory: BuilderListItemFactory {
resource: "/uk/me/bcowan/Rugby/gtk/score-item.ui";
};
model: NoSelection {
model: FilterListModel {
filter: CustomFilter try_filter {};
model: $RugbyListStore list_store {
score: bind scorespin.value;
};
items-changed => $list_store_items_changed_cb();
};
items-changed => $list_store_items_changed_cb();
};
};
}
}
}
};
};
}
}
}
};
}
ShortcutController {
......
......@@ -18,9 +18,9 @@ desktopdir = datadir / 'applications'
gnome = import('gnome')
gio_dep = dependency('gio-2.0', version: '>= 2.66')
gtk_dep = dependency('gtk4', version: '>= 4.8')
libadwaita_dep = dependency('libadwaita-1')
gio_dep = dependency('gio-2.0', version: '>= 2.76')
gtk_dep = dependency('gtk4', version: '>= 4.11.3')
libadwaita_dep = dependency('libadwaita-1', version: '>=1.4.beta')
conf = configuration_data()
......@@ -35,8 +35,8 @@ endif
cflags = ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_66',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66',
'-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_8',
'-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_8',
'-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_12',
'-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_12',
'-Wno-overlength-strings',
]
......
......@@ -97,9 +97,12 @@ render_bar (GtkWidget *widget,
&area);
gtk_snapshot_pop (snapshot);
GtkStyleContext *ctx = gtk_widget_get_style_context (widget);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GdkRGBA border_colour;
GtkStyleContext *ctx = gtk_widget_get_style_context (widget);
gtk_style_context_lookup_color (ctx, "card_fg_color", &border_colour);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_snapshot_append_border (snapshot,
&rounded,
......@@ -132,6 +135,7 @@ rugby_possibility_widget_snapshot (GtkWidget *widget,
NULL);
int score = tries * try_points + utries * utry_points + kicks * kick_points;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GtkStyleContext *ctx = gtk_widget_get_style_context (widget);
GdkRGBA rgba;
......@@ -161,6 +165,7 @@ rugby_possibility_widget_snapshot (GtkWidget *widget,
render_bar (widget, snapshot, x, w, height, rgba);
x += w;
}
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
......
......@@ -4,7 +4,7 @@
app-id: uk.me.bcowan.Rugby
runtime: org.gnome.Platform
runtime-version: "44"
runtime-version: "master"
sdk: org.gnome.Sdk
command: rugby
......
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