Skip to content

Commit

Permalink
fix #1456
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Oct 12, 2024
1 parent ab3f93b commit 7288ac4
Show file tree
Hide file tree
Showing 8 changed files with 384 additions and 356 deletions.
144 changes: 79 additions & 65 deletions build-aux/io.github.alainm23.planify.Devel.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"app-id": "io.github.alainm23.planify.Devel",
"runtime": "org.gnome.Platform",
"runtime-version": "46",
"sdk": "org.gnome.Sdk",
"command": "io.github.alainm23.planify.Devel",
"tags": ["devel"],
"finish-args": [
"app-id" : "io.github.alainm23.planify.Devel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "47",
"sdk" : "org.gnome.Sdk",
"command" : "io.github.alainm23.planify.Devel",
"tags" : [
"devel"
],
"finish-args" : [
"--device=dri",
"--share=ipc",
"--share=network",
Expand All @@ -18,7 +20,7 @@
"--own-name=io.github.alainm23.planify.quick-add",
"--own-name=io.github.alainm23.planify"
],
"cleanup": [
"cleanup" : [
"/include",
"/lib/pkgconfig",
"/man",
Expand All @@ -29,34 +31,38 @@
"*.la",
"*.a"
],
"modules": [
"modules" : [
{
"name": "intltool",
"cleanup": ["*"],
"sources": [
"name" : "intltool",
"cleanup" : [
"*"
],
"sources" : [
{
"type": "archive",
"url": "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz",
"sha256": "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
"type" : "archive",
"url" : "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz",
"sha256" : "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
}
]
},
{
"name": "granite",
"buildsystem": "meson",
"sources": [
"name" : "granite",
"buildsystem" : "meson",
"sources" : [
{
"type": "git",
"url": "https://github.com/elementary/granite.git",
"tag": "7.2.0"
"type" : "git",
"url" : "https://github.com/elementary/granite.git",
"tag" : "7.2.0"
}
]
},
{
"name": "libical",
"buildsystem": "cmake-ninja",
"cleanup": ["/lib/cmake"],
"config-opts": [
"name" : "libical",
"buildsystem" : "cmake-ninja",
"cleanup" : [
"/lib/cmake"
],
"config-opts" : [
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INSTALL_LIBDIR=/app/lib",
"-DBUILD_SHARED_LIBS=ON",
Expand All @@ -66,28 +72,28 @@
"-DICAL_BUILD_DOCS=false",
"-DWITH_CXX_BINDINGS=false"
],
"sources": [
"sources" : [
{
"type": "archive",
"url": "https://github.com/libical/libical/releases/download/v3.0.17/libical-3.0.17.tar.gz",
"sha256": "bcda9a6db6870240328752854d1ea475af9bbc6356e6771018200e475e5f781b",
"x-checker-data": {
"type": "anitya",
"project-id": 1637,
"url-template": "https://github.com/libical/libical/releases/download/v$version/libical-$version.tar.gz"
"type" : "archive",
"url" : "https://github.com/libical/libical/releases/download/v3.0.17/libical-3.0.17.tar.gz",
"sha256" : "bcda9a6db6870240328752854d1ea475af9bbc6356e6771018200e475e5f781b",
"x-checker-data" : {
"type" : "anitya",
"project-id" : 1637,
"url-template" : "https://github.com/libical/libical/releases/download/v$version/libical-$version.tar.gz"
}
}
]
},
{
"name": "evolution-data-server",
"buildsystem": "cmake-ninja",
"cleanup": [
"name" : "evolution-data-server",
"buildsystem" : "cmake-ninja",
"cleanup" : [
"/lib/evolution-data-server/*-backends",
"/libexec",
"/share/dbus-1/services"
],
"config-opts": [
"config-opts" : [
"-DCMAKE_BUILD_TYPE=Release",
"-DENABLE_FILE_LOCKING=fcntl",
"-DENABLE_DOT_LOCKING=OFF",
Expand All @@ -110,55 +116,63 @@
"-DENABLE_WEATHER=OFF",
"-DENABLE_OAUTH2_WEBKITGTK4=OFF"
],
"sources": [
"sources" : [
{
"type": "archive",
"url": "https://download.gnome.org/sources/evolution-data-server/3.50/evolution-data-server-3.50.2.tar.xz",
"sha256": "5e66270388d50c14f3b1ae3fa0d2127b9fedce752acd393b5545281b01fc4970",
"x-checker-data": {
"type": "gnome",
"name": "evolution-data-server"
"type" : "archive",
"url" : "https://download.gnome.org/sources/evolution-data-server/3.50/evolution-data-server-3.50.2.tar.xz",
"sha256" : "5e66270388d50c14f3b1ae3fa0d2127b9fedce752acd393b5545281b01fc4970",
"x-checker-data" : {
"type" : "gnome",
"name" : "evolution-data-server"
}
}
]
},
{
"name": "libportal",
"buildsystem": "meson",
"config-opts": [
"name" : "libportal",
"buildsystem" : "meson",
"config-opts" : [
"-Dbackends=['gtk4']",
"-Ddocs=false",
"-Dtests=false"
],
"sources": [
"sources" : [
{
"type": "git",
"url": "https://github.com/flatpak/libportal.git",
"tag": "0.6"
"type" : "git",
"url" : "https://github.com/flatpak/libportal.git",
"tag" : "0.6"
}
]
},
{
"name": "gxml",
"buildsystem": "meson",
"sources": [
"name" : "gxml",
"buildsystem" : "meson",
"sources" : [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gxml.git"
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gxml.git"
}
]
},
{
"name": "planify",
"builddir": true,
"buildsystem": "meson",
"config-opts": ["-Dtracing=true", "-Dprofile=development"],
"sources": [
"name" : "planify",
"builddir" : true,
"buildsystem" : "meson",
"config-opts" : [
"-Dtracing=true",
"-Dprofile=development",
"--libdir=lib"
],
"sources" : [
{
"type": "dir",
"path": "../"
"type" : "dir",
"path" : "../"
}
]
}
]
}
],
"build-options" : {
"env" : { }
}
}

19 changes: 16 additions & 3 deletions core/Widgets/ContextMenu/MenuItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ public class Widgets.ContextMenu.MenuItem : Gtk.Button {
}
}

bool _autohide_popover = true;
public bool autohide_popover {
get {
return _autohide_popover;
}

set {
_autohide_popover = value;
}
}

public string icon {
set {
if (value != null) {
Expand Down Expand Up @@ -178,9 +189,11 @@ public class Widgets.ContextMenu.MenuItem : Gtk.Button {
clicked.connect (() => {
activate_item ();

var popover = (Gtk.Popover) get_ancestor (typeof (Gtk.Popover));
if (popover != null) {
popover.popdown ();
if (autohide_popover) {
var popover = (Gtk.Popover) get_ancestor (typeof (Gtk.Popover));
if (popover != null) {
popover.popdown ();
}
}
});
}
Expand Down
7 changes: 6 additions & 1 deletion core/Widgets/DateTimePicker/DateTimePicker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ public class Widgets.DateTimePicker.DateTimePicker : Gtk.Popover {
next_week_item = new Widgets.ContextMenu.MenuItem (_("Next week"), "work-week-symbolic");
date_item = new Widgets.ContextMenu.MenuItem (_("Choose a date"), "month-symbolic");
date_item.arrow = true;
date_item.autohide_popover = false;

repeat_item = new Widgets.ContextMenu.MenuItem (_("Repeat"), "playlist-repeat-symbolic") {
margin_top = 6,
margin_bottom = 6
};
repeat_item.arrow = true;
repeat_item.autohide_popover = false;

var time_icon = new Gtk.Image.from_icon_name ("clock-symbolic") {
css_classes = { "dim-label" }
Expand Down Expand Up @@ -236,6 +238,7 @@ public class Widgets.DateTimePicker.DateTimePicker : Gtk.Popover {

private Adw.NavigationPage build_calendar_page () {
var back_item = new Widgets.ContextMenu.MenuItem (_("Back"), "go-previous-symbolic");
back_item.autohide_popover = false;

calendar_view = new Widgets.Calendar.Calendar ();

Expand Down Expand Up @@ -267,14 +270,16 @@ public class Widgets.DateTimePicker.DateTimePicker : Gtk.Popover {

private Adw.NavigationPage build_repeat_page () {
var back_item = new Widgets.ContextMenu.MenuItem (_("Back"), "go-previous-symbolic");

back_item.autohide_popover = false;

var none_item = new Widgets.ContextMenu.MenuItem (_("None"));
var daily_item = new Widgets.ContextMenu.MenuItem (_("Daily"));
var weekly_item = new Widgets.ContextMenu.MenuItem (_("Weekly"));
var monthly_item = new Widgets.ContextMenu.MenuItem (_("Monthly"));
var yearly_item = new Widgets.ContextMenu.MenuItem (_("Yearly"));
var custom_item = new Widgets.ContextMenu.MenuItem (_("Custom"));
custom_item.arrow = true;
custom_item.autohide_popover = false;

var menu_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
menu_box.margin_top = menu_box.margin_bottom = 3;
Expand Down
1 change: 1 addition & 0 deletions core/Widgets/DateTimePicker/RepeatConfig.vala
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class Widgets.DateTimePicker.RepeatConfig : Adw.NavigationPage {

construct {
var back_item = new Widgets.ContextMenu.MenuItem (_("Back"), "go-previous-symbolic");
back_item.autohide_popover = false;

repeat_label = new Gtk.Label (null) {
margin_top = 9,
Expand Down
1 change: 1 addition & 0 deletions core/Widgets/ReminderPicker/ReminderPicker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public class Widgets.ReminderPicker.ReminderPicker : Gtk.Popover {

private Gtk.Widget get_picker () {
var back_item = new Widgets.ContextMenu.MenuItem (_("Back"), "go-previous-symbolic");
back_item.autohide_popover = false;

calendar = new Widgets.Calendar.Calendar () {
vexpand = true,
Expand Down
Loading

0 comments on commit 7288ac4

Please sign in to comment.