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

Update Spinner demo to AdwSpinner #205

Merged
merged 1 commit into from
Sep 26, 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 src/About Dialog/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn on_button_clicked() {

dialog.add_link(
"Documentation",
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.AboutDialog.html",
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.AboutDialog.html",
);

dialog.add_legal_section(
Expand Down
2 changes: 1 addition & 1 deletion src/About Dialog/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Adw.StatusPage {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.AboutDialog.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.AboutDialog.html";
}
}
}
2 changes: 1 addition & 1 deletion src/About Dialog/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function openAboutDialog() {

dialog.add_link(
_("Documentation"),
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.AboutDialog.html",
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.AboutDialog.html",
);

dialog.add_legal_section(
Expand Down
2 changes: 1 addition & 1 deletion src/About Dialog/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def open_about_window(_widget):

dialog.add_link(
_("Documentation"),
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.AboutDialog.html",
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.AboutDialog.html",
)

dialog.add_legal_section(
Expand Down
2 changes: 1 addition & 1 deletion src/About Dialog/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void on_button_clicked () {
};
dialog.add_link (
"Documentation",
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.AboutDialog.html"
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.AboutDialog.html"
);
dialog.add_legal_section (
"Fonts",
Expand Down
4 changes: 2 additions & 2 deletions src/Advanced Buttons/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Adw.StatusPage {
LinkButton {
margin-bottom: 36;
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.SplitButton.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.SplitButton.html";
}

Box {
Expand Down Expand Up @@ -157,7 +157,7 @@ Adw.StatusPage {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.ButtonContent.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.ButtonContent.html";
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Animation/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ Adw.Clamp {

LinkButton {
label: _("Timed Animation");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.TimedAnimation.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.TimedAnimation.html";
}

LinkButton {
label: _("Spring Animation");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.SpringAnimation.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.SpringAnimation.html";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Avatar/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Adw.StatusPage {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.Avatar.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Avatar.html";
}
}
}
2 changes: 1 addition & 1 deletion src/Banner/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Adw.ToastOverlay overlay {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.Banner.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Banner.html";
}

LinkButton {
Expand Down
2 changes: 1 addition & 1 deletion src/Boxed Lists/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Adw.StatusPage {
LinkButton {
margin-top: 24;
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/boxed-lists.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/boxed-lists.html";
}

LinkButton {
Expand Down
4 changes: 2 additions & 2 deletions src/Breakpoints/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ Gtk.Window {
LinkButton {
margin-top: 24;
label: _("Breakpoint");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.Breakpoint.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Breakpoint.html";
}

LinkButton {
label: _("Breakpoint Bin");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.BreakpointBin.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.BreakpointBin.html";
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Carousel/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Box root_box {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.Carousel.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Carousel.html";
margin-top: 12;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Clamp/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Adw.StatusPage {
LinkButton {
margin-top: 12;
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.Clamp.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Clamp.html";
}

Adw.Clamp clamp {
Expand Down
2 changes: 1 addition & 1 deletion src/Dialog/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Adw.StatusPage {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.Dialog.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Dialog.html";
}

LinkButton {
Expand Down
2 changes: 1 addition & 1 deletion src/Header Bar/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Gtk.Window {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.HeaderBar.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.HeaderBar.html";
}

LinkButton {
Expand Down
2 changes: 1 addition & 1 deletion src/Message Dialogs/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Adw.StatusPage {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.AlertDialog.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.AlertDialog.html";
}

LinkButton {
Expand Down
2 changes: 1 addition & 1 deletion src/Navigation Split View/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Adw.Window {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.NavigationSplitView.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.NavigationSplitView.html";
}
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/Navigation View/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Adw.StatusPage {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.NavigationView.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.NavigationView.html";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Overlay Split View/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Adw.Window {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.OverlaySplitView.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.OverlaySplitView.html";
margin-top: 24;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Preferences Dialog/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ Adw.StatusPage {

LinkButton {
label: _("PreferencesDialog");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.PreferencesDialog.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.PreferencesDialog.html";
}

LinkButton {
label: _("PreferencesPage");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.PreferencesPage.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.PreferencesPage.html";
}

LinkButton {
label: _("PreferencesGroup");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.PreferencesGroup.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.PreferencesGroup.html";
}

LinkButton {
label: _("PreferencesRow");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.PreferencesRow.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.PreferencesRow.html";
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Spinner/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ pub fn main() {
let spinner: gtk::Spinner = workbench::builder().object("spinner").unwrap();

button.connect_clicked(move |button| {
if spinner.is_spinning() {
if spinner.is_visible() {
button.set_icon_name("media-playback-start");
spinner.set_spinning(false);
spinner.set_visible(false);
} else {
button.set_icon_name("media-playback-pause");
spinner.set_spinning(true);
button.set_icon_name("media-playback-stop");
spinner.set_visible(true);
}
});
}
33 changes: 17 additions & 16 deletions src/Spinner/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,36 @@ Adw.StatusPage {
Box {
orientation: vertical;
halign: center;
spacing: 24;

Spinner spinner {
spinning: true;
margin-bottom: 30;
Adw.Spinner spinner {
halign: center;
valign: center;
width-request: 48;
height-request: 48;
}

Button button {
icon-name: "media-playback-pause";
margin-bottom: 30;
icon-name: "media-playback-stop";
halign: center;

styles [
"circular"
]
}

LinkButton {
label: _("Tutorial");
uri: "https://developer.gnome.org/documentation/tutorials/beginners/components/spinner.html";
}
Box {
orientation: vertical;

LinkButton {
label: _("API Reference");
uri: "https://docs.gtk.org/gtk4/class.Spinner.html";
}
LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.Spinner.html";
}

LinkButton {
label: _("Human Interface Guidelines");
uri: "https://developer.gnome.org/hig/patterns/feedback/spinners.html";
LinkButton {
label: _("Human Interface Guidelines");
uri: "https://developer.gnome.org/hig/patterns/feedback/spinners.html";
}
}
}
}
8 changes: 4 additions & 4 deletions src/Spinner/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const button = workbench.builder.get_object("button");
const spinner = workbench.builder.get_object("spinner");

button.connect("clicked", () => {
if (spinner.spinning === true) {
if (spinner.visible === true) {
button.icon_name = "media-playback-start";
spinner.spinning = false;
spinner.visible = false;
} else {
button.icon_name = "media-playback-pause";
spinner.spinning = true;
button.icon_name = "media-playback-stop";
spinner.visible = true;
}
});
3 changes: 2 additions & 1 deletion src/Spinner/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"category": "feedback",
"description": "Display loading state",
"panels": ["ui", "preview"],
"autorun": true
"autorun": true,
"runtime-version": "47"
}
8 changes: 4 additions & 4 deletions src/Spinner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@


def button_clicked(_widget):
if spinner.get_spinning():
if spinner.get_visible():
button.set_icon_name("media-playback-start")
spinner.set_spinning(False)
spinner.set_visible(False)
else:
button.set_icon_name("media-playback-pause")
spinner.set_spinning(True)
button.set_icon_name("media-playback-stop")
spinner.set_visible(True)


button.connect("clicked", button_clicked)
8 changes: 4 additions & 4 deletions src/Spinner/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ public void main () {
var spinner = (Gtk.Spinner) workbench.builder.get_object ("spinner");

button.clicked.connect (() => {
if (spinner.spinning) {
if (spinner.visible) {
button.icon_name = "media-playback-start";
spinner.spinning = false;
spinner.visible = false;
} else {
button.icon_name = "media-playback-pause";
spinner.spinning = true;
button.icon_name = "media-playback-stop";
spinner.visible = true;
}
});
}
2 changes: 1 addition & 1 deletion src/Status Page/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Adw.StatusPage status_page {

LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.StatusPage.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.StatusPage.html";
}

LinkButton {
Expand Down
4 changes: 2 additions & 2 deletions src/Styling with CSS/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ Adw.StatusPage {

LinkButton {
label: _("Style Classes");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/style-classes.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/style-classes.html";
}

LinkButton {
label: _("Named Colors");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/named-colors.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/named-colors.html";
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Tab View/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ Adw.Window {

LinkButton {
label: _("Tab View");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.TabView.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.TabView.html";
}

LinkButton {
label: _("Tab Bar");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.TabBar.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.TabBar.html";
}

LinkButton {
label: _("Tab Overview");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/class.TabOverview.html";
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.6/class.TabOverview.html";
}
}

Expand Down
Loading
Loading