diff --git a/src/Library/demos/Calendar/main.blp b/src/Library/demos/Calendar/main.blp index cead59688..c6c0c9fb1 100644 --- a/src/Library/demos/Calendar/main.blp +++ b/src/Library/demos/Calendar/main.blp @@ -3,43 +3,23 @@ using Adw 1; Adw.StatusPage { title: "Calendar"; - description: "Widget that helps you keep track of events"; + description: "Display a Gregorian calendar, one month at a time"; - Box { - orientation: vertical; - halign: center; + Box { + orientation: vertical; + halign: center; Calendar calendar { show-day-names: true; - show-week-numbers: true; + show-week-numbers: false; show-heading: true; margin-bottom: 18; - } - - Box { - spacing: 6; - halign: center; - margin-bottom: 12; - - Button mark { - icon-name: "plus"; - } - - Button remove_mark { - icon-name: "minus"; - } + day: 1; } LinkButton { - label: "API Refernce"; + label: "API Reference"; uri: "https://docs.gtk.org/gtk4/class.Calendar.html"; - } + } } - } - - - - - - - +} diff --git a/src/Library/demos/Calendar/main.js b/src/Library/demos/Calendar/main.js index 219ba0ade..33baaba19 100644 --- a/src/Library/demos/Calendar/main.js +++ b/src/Library/demos/Calendar/main.js @@ -1,35 +1,15 @@ const calendar = workbench.builder.get_object("calendar"); -const mark = workbench.builder.get_object("mark"); -const remove_mark = workbench.builder.get_object("remove_mark"); calendar.connect("notify::day", () => { - console.log(`Selected Date: ${calendar.get_date().format("%x")}`); + console.log(calendar.get_date().format("%x")); }); calendar.connect("notify::month", () => { - console.log(`Switched to Month: ${calendar.get_date().format("%B")}`); + console.log(calendar.get_date().format("%B")); }); calendar.connect("notify::year", () => { - console.log(`Switched to Year: ${calendar.get_date().format("%Y")}`); + console.log(calendar.get_date().format("%Y")); }); -mark.connect("clicked", () => { - const selectedDate = calendar.get_date().format("%d"); - console.log( - calendar.get_day_is_marked(selectedDate) - ? "Date already marked" - : "Date marked", - ); - calendar.mark_day(selectedDate); -}); - -remove_mark.connect("clicked", () => { - const selectedDate = calendar.get_date().format("%d"); - console.log( - calendar.get_day_is_marked(selectedDate) - ? "Date Unmarked" - : "Date not yet marked", - ); - calendar.unmark_day(selectedDate); -}); +calendar.mark_day(15); diff --git a/src/Library/demos/Calendar/main.json b/src/Library/demos/Calendar/main.json index c47d4e6e1..a23dcc046 100644 --- a/src/Library/demos/Calendar/main.json +++ b/src/Library/demos/Calendar/main.json @@ -1,7 +1,7 @@ { "name": "Calendar", "category": "user_interface", - "description": "Widget that helps you keep track of events", + "description": "Display a Gregorian calendar, one month at a time", "panels": [ "ui", "preview" diff --git a/src/Library/demos/Picture/bbb.jpg b/src/Library/demos/Picture/bbb.jpg new file mode 100644 index 000000000..0eabbfd57 Binary files /dev/null and b/src/Library/demos/Picture/bbb.jpg differ diff --git a/src/Library/demos/Picture/main.json b/src/Library/demos/Picture/main.json new file mode 100644 index 000000000..dac392a0e --- /dev/null +++ b/src/Library/demos/Picture/main.json @@ -0,0 +1,10 @@ +{ + "name": "Picture", + "category": "user_interface", + "description": "Something something", + "panels": [ + "preview", + "ui" + ], + "autorun": true +} \ No newline at end of file