Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bruce Cowan
Rugby
Commits
73458cbe
Verified
Commit
73458cbe
authored
1 year ago
by
Bruce Cowan
Browse files
Options
Downloads
Patches
Plain Diff
Use new Adwaita widgets
parent
2c102f97
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
data/gtk/window.blp
+54
-50
54 additions, 50 deletions
data/gtk/window.blp
meson.build
+5
-5
5 additions, 5 deletions
meson.build
src/rugby-possibility-widget.c
+6
-1
6 additions, 1 deletion
src/rugby-possibility-widget.c
uk.me.bcowan.Rugby.yml
+1
-1
1 addition, 1 deletion
uk.me.bcowan.Rugby.yml
with
66 additions
and
57 deletions
data/gtk/window.blp
+
54
−
50
View file @
73458cbe
...
...
@@ -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 {
...
...
This diff is collapsed.
Click to expand it.
meson.build
+
5
−
5
View file @
73458cbe
...
...
@@ -18,9 +18,9 @@ desktopdir = datadir / 'applications'
gnome
=
import
(
'gnome'
)
gio_dep
=
dependency
(
'gio-2.0'
,
version
:
'>= 2.
6
6'
)
gtk_dep
=
dependency
(
'gtk4'
,
version
:
'>= 4.
8
'
)
libadwaita_dep
=
dependency
(
'libadwaita-1'
)
gio_dep
=
dependency
(
'gio-2.0'
,
version
:
'>= 2.
7
6'
)
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'
,
]
...
...
This diff is collapsed.
Click to expand it.
src/rugby-possibility-widget.c
+
6
−
1
View file @
73458cbe
...
...
@@ -97,9 +97,12 @@ render_bar (GtkWidget *widget,
&
area
);
gtk_snapshot_pop
(
snapshot
);
G
tkStyleContext
*
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
...
...
This diff is collapsed.
Click to expand it.
uk.me.bcowan.Rugby.yml
+
1
−
1
View file @
73458cbe
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment