-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6728f0d
commit 8b53bab
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Gtk 4.0; | ||
using Adw 1; | ||
|
||
Adw.StatusPage{ | ||
title: "Button"; | ||
description: "A simple way to trigger an event"; | ||
|
||
Box { | ||
orientation: vertical; | ||
|
||
Box { | ||
orientation: vertical; | ||
halign: center; | ||
|
||
Button test_button { | ||
label: "Active Button"; | ||
margin-bottom: 30; | ||
styles ["pill","flat"] | ||
} | ||
|
||
Button disabled_button { | ||
label: "Disabled Button"; | ||
margin-bottom: 30; | ||
sensitive: false; | ||
styles ["pill","destructive-action"] | ||
} | ||
|
||
LinkButton{ | ||
label: "Tutorial"; | ||
uri: "https://developer.gnome.org/documentation/tutorials/beginners/components/button.html"; | ||
} | ||
|
||
LinkButton{ | ||
label: "API Reference"; | ||
uri: "https://docs.gtk.org/gtk4/class.Button.html"; | ||
} | ||
|
||
LinkButton{ | ||
label: "Human Interface Guidelines"; | ||
uri: "https://developer.gnome.org/hig/patterns/controls/buttons.html"; | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Gtk from "gi://Gtk?version=4.0"; | ||
import GObject from "gi://GObject"; | ||
|
||
const test_button = workbench.builder.get_object("test_button"); | ||
function handle_click() { | ||
const dialog = new Gtk.MessageDialog({ | ||
text: "Button was Clicked", | ||
transient_for: workbench.window, | ||
modal: true, | ||
buttons: Gtk.ButtonsType.OK, | ||
}); | ||
dialog.connect("response", () => { | ||
dialog.close(); | ||
}); | ||
|
||
dialog.present(); | ||
} | ||
|
||
test_button.connect("clicked", handle_click); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "Button", | ||
"category": "user_interface", | ||
"description": "A simple way to trigger an event", | ||
"panels": [ | ||
"ui", | ||
"preview" | ||
], | ||
"autorun": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters