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

Port to Gtk4 #358

Draft
wants to merge 98 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
40c0f10
Part 1 (doesn't compile yet)
lenemter Jun 4, 2023
7ea7f10
It compiles!
lenemter Jun 4, 2023
18e8ac0
Fix CSS errors
lenemter Jun 4, 2023
0b956ef
Some fixes
lenemter Jun 4, 2023
8e8edf1
Fix headers
lenemter Jun 4, 2023
62b389a
Use `add_css_class` and fix some warnings
lenemter Jun 4, 2023
d91fe45
Fix terminal warnings
lenemter Jun 4, 2023
5d957ae
Fix warning
lenemter Jun 4, 2023
bd053f7
FIx SimpleAction error
lenemter Jun 4, 2023
7834c76
Remove debug message
lenemter Jun 4, 2023
224c4de
Fix segmentation fault
lenemter Jun 4, 2023
5b2fcc1
Fix focus issue
lenemter Jun 5, 2023
0dfbd7f
Try to fix button
lenemter Jun 5, 2023
6ab5a0e
Improve DateTime widget appearance
lenemter Jun 5, 2023
4b208ac
Fix calendar icon
lenemter Jun 5, 2023
a8a7caa
Calendar widget again
lenemter Jun 5, 2023
3aff64b
Compile Location.vala
lenemter Jun 5, 2023
f4279fa
Show location icon
lenemter Jun 5, 2023
495dd9b
Use ActionBar for task buttons
lenemter Jun 5, 2023
00cde6f
Fix delete_list style
lenemter Jun 5, 2023
c01332c
Try to fix EditableLabel
lenemter Jun 5, 2023
d4f6b2f
Fix EntryPopover style
lenemter Jun 5, 2023
cbd6232
Finally fix EntryPopover styles
lenemter Jun 5, 2023
8adae24
Fix lint
lenemter Jun 5, 2023
ab073f9
Finally fix EditableLabel style
lenemter Jun 5, 2023
3150134
Use the same mechanism for TaskRow
lenemter Jun 5, 2023
358dced
Fix tasklist colors
lenemter Jun 5, 2023
d893599
Fix
lenemter Jun 5, 2023
acc2930
Use Gtk.Grid for task buttons
lenemter Jun 5, 2023
a3c1e2e
DRY
lenemter Jun 5, 2023
061695f
Use PopoverButton
lenemter Jun 5, 2023
b93f598
MainWindow: Cleanup
lenemter Jun 5, 2023
4675274
Rework loops
lenemter Jun 5, 2023
ace6d6a
Commit message
lenemter Jun 5, 2023
e853c70
Fix deletion of the task list
lenemter Jun 5, 2023
263f12a
Square delete button
lenemter Jun 5, 2023
640bcf1
editable-label button
lenemter Jun 5, 2023
17498d3
Some copyrights
lenemter Jun 5, 2023
5056f68
Attempt to add dnd
lenemter Jun 5, 2023
8f611fe
Remove redundant code
lenemter Jun 5, 2023
25bd91e
I can't figure out how to do drag and drop, so at least make it look …
lenemter Jun 5, 2023
434c96a
Wow it highlights now
lenemter Jun 5, 2023
8e48a31
Fix dark EntryPopover styles
lenemter Jun 5, 2023
4ca903c
Fix 2
lenemter Jun 5, 2023
6cb85b6
Fix drag and drop
lenemter Jun 6, 2023
aaed48a
An attempt to improve dnd
lenemter Jun 6, 2023
b5944d5
Fix dnd
lenemter Jun 6, 2023
a8e50aa
Remove debug
lenemter Jun 6, 2023
d3c6df9
Some styles fixes
lenemter Jun 6, 2023
0b7c694
Use SizeGroup
lenemter Jun 6, 2023
944223e
Add ButtonBox style
lenemter Jun 6, 2023
2851b10
Fix style class
lenemter Jun 6, 2023
5d61e27
Move placeholder
lenemter Jun 6, 2023
0035a09
Fix lint
lenemter Jun 6, 2023
5ff81bc
Don't remove placeholder from task_list
lenemter Jun 6, 2023
a812171
Remove children from task_list
lenemter Jun 6, 2023
b00ec0b
Remove children from box too
lenemter Jun 6, 2023
9ad0135
Try to fix dnd
lenemter Jun 6, 2023
2804f6d
Fix spacing
lenemter Jun 10, 2023
25a4976
Fix "Today" label alignment
lenemter Jun 10, 2023
3d490e3
Merge branch 'master' into lenemter/gtk4
lenemter Jul 8, 2023
7bafaec
Fix merge
lenemter Jul 8, 2023
75c125a
Merge branch 'master' into lenemter/gtk4
lenemter Aug 4, 2023
af71299
Don't use `css_classes`
lenemter Aug 4, 2023
cd6d6e5
Merge master
danirabbit May 15, 2024
202e248
Make buttonbox homogeneous
danirabbit May 15, 2024
71b0100
Granite.init
danirabbit May 15, 2024
40b88b4
Icons are added automatically
danirabbit May 15, 2024
a5825a9
child, but alphabetize
danirabbit May 15, 2024
35f85b3
CSS for menu
danirabbit May 15, 2024
c0fba99
Try to reduce diff
danirabbit May 15, 2024
bd82576
Revert network monitor stuff
danirabbit May 15, 2024
2ef1540
Merge master
danirabbit May 15, 2024
f4a88b8
Remove disable deprecated thing
danirabbit May 15, 2024
0a0d0bd
merge master
danirabbit May 16, 2024
0204080
code style
danirabbit May 16, 2024
854caec
Use has_frame property
danirabbit May 16, 2024
957664a
Revert "Revert network monitor stuff"
danirabbit May 16, 2024
dfa5d7f
TaskListGrid: use toolbarview (#384)
danirabbit May 16, 2024
fa1b06f
provider from string
danirabbit May 16, 2024
79f6a5f
Revert "TaskListGrid: use toolbarview (#384)"
danirabbit May 16, 2024
15445d7
Merge branch 'master' into lenemter/gtk4
danirabbit May 21, 2024
ac91fbb
Reduce diff
danirabbit May 21, 2024
143b97d
Use function for remove_all
danirabbit May 21, 2024
633ec3c
Merge master
danirabbit May 30, 2024
185c053
Remove duplicate placeholder
danirabbit May 30, 2024
e6ee17a
don't need to cache placeholder
danirabbit May 30, 2024
cfcfd27
Merge main
danirabbit Jun 5, 2024
48d3173
remove extra comma
danirabbit Jun 5, 2024
e0abd07
merge master
danirabbit Jun 10, 2024
9ea03a6
Remove duplicate code from bad merge
danirabbit Jun 10, 2024
5fb4513
Simplify CSS
danirabbit Jun 10, 2024
34d7efe
Simplify more
danirabbit Jun 10, 2024
1608678
CSS: even simpler
danirabbit Jun 10, 2024
1135e7c
Merge branch 'master' into lenemter/gtk4
danirabbit Jun 10, 2024
a9d27fe
Merge branch 'master' into lenemter/gtk4
danirabbit Jul 11, 2024
e8ae3c7
Update flatpak manifest
danirabbit Jul 11, 2024
8995e62
Merge master
danirabbit Sep 5, 2024
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 data/gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<file compressed="true">Application.css</file>
</gresource>
<gresource prefix="/io/elementary/tasks/icons">
<file alias="location-marker.svg" compressed="true" preprocess="xml-stripblanks">LocationMarker.svg</file>
<file alias="location-marker.svg" compressed="true" preprocess="xml-stripblanks">LocationMarker.svg</file>
</gresource>
</gresources>
13 changes: 9 additions & 4 deletions data/gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
<summary>Whether the window was maximized on last run</summary>
<description>Whether the window was maximized on last run</description>
</key>
<key name="window-size" type="(ii)">
<default>(1000, 800)</default>
<summary>Most recent window size</summary>
<description>Most recent window size (width, height)</description>
<key name="window-width" type="i">
<default>1024</default>
<summary>Most recent window width</summary>
<description>Most recent window width</description>
</key>
<key name="window-height" type="i">
<default>750</default>
<summary>Most recent window height</summary>
<description>Most recent window height</description>
</key>
<key name="pane-position" type="i">
<default>256</default>
Expand Down
102 changes: 21 additions & 81 deletions io.elementary.tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,87 +95,6 @@
}
]
},
{
"name": "clutter-gtk",
"cleanup": [
"/share/gtk-doc"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/clutter-gtk/1.8/clutter-gtk-1.8.4.tar.xz",
"sha256": "521493ec038973c77edcb8bc5eac23eed41645117894aaee7300b2487cb42b06"
}
],
"modules": [
{
"name": "cogl",
"config-opts": [
"--disable-cogl-gst",
"--disable-gtk-doc",
"--enable-xlib-egl-platform",
"--enable-wayland-egl-platform"
],
"cleanup": [
"/share/gtk-doc",
"/share/cogl/examples-data"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/cogl/1.22/cogl-1.22.8.tar.xz",
"sha256": "a805b2b019184710ff53d0496f9f0ce6dcca420c141a0f4f6fcc02131581d759"
}
]
},
{
"name": "clutter",
"config-opts": [
"--disable-gtk-doc",
"--enable-egl-backend",
"--enable-wayland-backend",
"--enable-deprecated=no"
],
"cleanup": [
"/share/gtk-doc"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/clutter/1.26/clutter-1.26.4.tar.xz",
"sha256": "8b48fac159843f556d0a6be3dbfc6b083fc6d9c58a20a49a6b4919ab4263c4e6"
}
]
},
{
"name": "clutter-gst",
"config-opts": [
"--disable-gtk-doc"
],
"cleanup": [
"/share/gtk-doc"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/clutter-gst/3.0/clutter-gst-3.0.27.tar.xz",
"sha256": "fe69bd6c659d24ab30da3f091eb91cd1970026d431179b0724f13791e8ad9f9d"
}
]
}
]
},
{
"name": "champlain",
"buildsystem": "meson",
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/libchamplain/0.12/libchamplain-0.12.21.tar.xz",
"sha256": "a915cd172a0c52944c5579fcb4683f8a878c571bf5e928254b5dafefc727e5a7"
}
]
},
{
"name": "geocode-glib-2.0",
"buildsystem": "meson",
Expand Down Expand Up @@ -211,6 +130,27 @@
}
]
},
{
"name": "libshumate",
"buildsystem": "meson",
"config-opts": [
"-Ddemos=false",
"-Dgtk_doc=false",
"-Dvapi=false"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/libshumate/1.2/libshumate-1.2.1.tar.xz",
"sha256": "1105ee077e2147f2a039cddfa616fa5cb9438883dd940427e11699dcd6549c11",
"x-checker-data": {
"type": "gnome",
"stable-only": false,
"name": "libshumate"
}
}
]
},
{
"name": "tasks",
"buildsystem": "meson",
Expand Down
21 changes: 9 additions & 12 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,17 @@ config_file = configure_file(
libecal_dep = dependency('libecal-2.0')

tasks_deps = [
dependency('champlain-0.12'),
dependency('champlain-gtk-0.12'),
dependency('clutter-1.0'),
dependency('clutter-gtk-1.0'),
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('granite', version: '>=6.2.0'),
dependency('gtk+-3.0'),
dependency('granite-7', version: '>=7.0.0'),
dependency('gtk4', version: '>=4.12'),
libecal_dep,
dependency('libedataserver-1.2'),
dependency('libgeoclue-2.0'),
dependency('libhandy-1', version: '>=0.90.0'),
dependency('shumate-1.0'),
dependency('libical-glib'),
dependency('libportal'),
dependency('libportal-gtk3')
dependency('libportal-gtk4')
]

if libecal_dep.version().version_compare('>=3.46.0')
Expand All @@ -66,19 +62,20 @@ executable(
'src/Application.vala',
'src/Location.vala',
'src/MainWindow.vala',
'src/TaskModel.vala',
'src/TodayTaskMonitor.vala',
'src/Util.vala',
'src/Widgets/EditableLabel.vala',
'src/Widgets/EntryPopover/DateTime.vala',
'src/Widgets/EntryPopover/Generic.vala',
'src/Widgets/EntryPopover/Location.vala',
'src/Widgets/EditableLabel.vala',
'src/Widgets/ListSettingsPopover.vala',
'src/Widgets/PopoverButton.vala',
'src/Widgets/ScheduledRow.vala',
'src/Widgets/SourceRow.vala',
'src/Widgets/ScheduledTaskListBox.vala',
'src/Widgets/SourceRow.vala',
'src/Widgets/TaskListGrid.vala',
'src/Widgets/TaskRow.vala',
'src/Widgets/ListSettingsPopover.vala',
'src/TaskModel.vala',
dependencies: tasks_deps,
install : true
)
Expand Down
37 changes: 13 additions & 24 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ public class Tasks.Application : Gtk.Application {
public static Tasks.TaskModel model;
public static bool run_in_background = false;

public const Gtk.TargetEntry[] DRAG_AND_DROP_TASK_DATA = {
{ "text/uri-list", Gtk.TargetFlags.SAME_APP | Gtk.TargetFlags.OTHER_WIDGET, 0 } // TODO: TEXT_URI
};

private bool first_activation = true;

public Application () {
Object (
application_id: "io.elementary.tasks",
Expand All @@ -58,7 +53,7 @@ public class Tasks.Application : Gtk.Application {
protected override void startup () {
base.startup ();

Hdy.init ();
Granite.init ();

unowned var granite_settings = Granite.Settings.get_default ();
unowned var gtk_settings = Gtk.Settings.get_default ();
Expand All @@ -69,11 +64,6 @@ public class Tasks.Application : Gtk.Application {
gtk_settings.gtk_application_prefer_dark_theme = ((Granite.Settings) obj).prefers_color_scheme == DARK;
});

var css_provider = new Gtk.CssProvider ();
css_provider.load_from_resource ("io/elementary/tasks/Application.css");

Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

var quit_action = new SimpleAction ("quit", null);
quit_action.activate.connect (() => {
if (active_window != null) {
Expand Down Expand Up @@ -105,15 +95,19 @@ public class Tasks.Application : Gtk.Application {
var main_window = new MainWindow (this);
add_window (main_window);

var rect = Gtk.Allocation ();
settings.get ("window-size", "(ii)", out rect.width, out rect.height);
main_window.set_allocation (rect);
/*
* This is very finicky. Bind size after present else set_titlebar gives us bad sizes
* Set maximize after height/width else window is min size on unmaximize
* Bind maximize as SET else get get bad sizes
*/
settings.bind ("window-height", main_window, "default-height", DEFAULT);
settings.bind ("window-width", main_window, "default-width", DEFAULT);

if (settings.get_boolean ("window-maximized")) {
main_window.maximize ();
}

main_window.show_all ();
settings.bind ("window-maximized", main_window, "maximized", SET);
}

active_window.present ();
Expand Down Expand Up @@ -153,7 +147,7 @@ public class Tasks.Application : Gtk.Application {
if (providers == null) {
providers = new Gee.HashMap<string, Gtk.CssProvider> ();
}
var task_list = (E.SourceTaskList?) source.get_extension (E.SOURCE_EXTENSION_TASK_LIST);
unowned var task_list = (E.SourceTaskList?) source.get_extension (E.SOURCE_EXTENSION_TASK_LIST);
// Ensure we get a valid CSS color, not including FF
var color = task_list.dup_color ().slice (0, 7);
if (!providers.has_key (color)) {
Expand All @@ -162,21 +156,16 @@ public class Tasks.Application : Gtk.Application {
@define-color accent_color %s;
""".printf (color, color);

try {
var style_provider = new Gtk.CssProvider ();
style_provider.load_from_data (style, style.length);
var style_provider = new Gtk.CssProvider ();
style_provider.load_from_string (style);

providers[color] = style_provider;
} catch (Error e) {
critical ("Unable to set color: %s", e.message);
}
providers[color] = style_provider;
}

widget.get_style_context ().add_provider (providers[color], Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}

public static int main (string[] args) {
GtkClutter.init (ref args);
var app = new Application ();
int res = app.run (args);
ICal.Object.free_global_objects ();
Expand Down
Loading
Loading