Thanks! #69
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First of all, thanks for your great effort!
I wrote a beautiful application for macOS in SwiftUI for guitar players using the Open Source ChordPro format:
Chord Provider
I’m also a contributor to that project and take care of the macOS version.
However; my heart is still at Linux and I wanted to port my application. Rewrote the core to
Foundation; wrote a CLI package and now, the GUI...It took me about two days to get a grip of your code but the result is a reasonable application:
Truly enjoyable to write this!
There are issues, obviously:
EmptyView()Thanks; I enjoy this!
Nick
This is so cool! Thank you very much! I’ve fixed a problem in
ForEachthat affected your render view so please update to the latest package version. I‘ll take a look at your split views, this is an awesome addition!I’m very looking forward to your further development and hope we can improve Adwaita for Swift!
Oh wow, this
ForEachfix fixed my crashes when running as flatpak!I was breaking my head over this; when just doing
swift runin the Terminal all was fine...My to-do list (in random order):
quit()function somehow. When a song is edited it should show a dialog if you want to save the file.ArgumentParserpackage for that. I already use that in myCLIversion.cli. I would like to have a very simple webview for the Gnome version and looking into this: https://github.com/javalikescript/webview-c WebKitGTK does not compile on macOS so that is no option.SourceEditor. That is why I cloned your package; to add a custom language... that I want to send as PR toGtkSourceViewwhen ready.Anyway, a flatpak release is much closer than I ever thought! Your code is very well documented so it was not so hard to get a grip on it.
Progress!!
sourceEditoradwaita-swiftis full with hidden treasures!This is so cool! Congratulations!
I've just added
HSplitViewandVSplitViewto the main branch (here - I rewrote it using a more declarative approach that is actually slightly more efficient) - thanks for your work!Wow, that’s much different and cleaner than mine! Learning every day :-)
Now, besides making the chord diagrams more fancy (cairo, I have to learn
cnow as well) my next challenge is to trap thequit.The quickest trick was adding
.deletable(false)to the Window but I don’t like that... It feels cheap so I removed it.The logic for an ‘unsaved’ state is already implemented. Open a new song or quitting from the menu shows a dialog when the song is edited.
I hacked around in your code with mixed result. I can add a
signaland trap thequitbut since asignalclosure is a void I can never actually quit :-)Any pointers?
Or maybe an optional
.onQuitmodifier? That returnstrueorfalseor something like that?Next, let it open songs from
Files...I found a couple of bugs; they are on my list to tell you. It might be wrong implementation from my side so still investigating...
And one more question:
Why do you use
SQLiteas backend for storage? Since all stuff to store has to confirm tocodableyou might as well store it in JSON. I do that for my settings:SettingsCache
I like that more because its in its own file. Correct me if I’m wrong, but it looks to me all stored states are in the same
data.sqlitedatabase. So if I store the width and height state of my Window, and another application does that as well; it will override each other.But, most important, it’s great fun to write an Adwaita application in Swift! Never thought I could write a Linux version of my macOS application so easy. Thanks!
Great work! And sorry for ignoring your comment for so long, updating the Swift Freedesktop SDK Extension for GNOME 49 was trickier than I expected :)
onClosetoWindowwhich gets executed if the user closes the window, quits using the context menu in the dash/headerbar or afterwindow.close(). It does not get executed afterapp.quit, so this has to be handled separately.data.sqlite. Thanks for bringing this up!Thanks for the nice feedback, it's awesome to see people using my project. I'm looking forward to working on the bugs you found!
This works great! It looks like there is no
app.quitin the Gnome overview. When IquitI can still trap it. Happy about that :-)However, it feels unnatural for me to return
trueto avoid closing the window. Reading the GTK source, it is correct. Returningtrueavoids closing. In my opinion, it should be the other way around. But... better keep to their implementation.My document implementation is a bit smelly... To make Chord Provider working with
FilesI give every newappan unique ID. Result is that if you click on a song inFilesit opens a new instance of Chord Provider. Works fine but feels like a hack...Found another issue (should I make a new issue for that?). I cannot select a folder with the
FilePicker. In the source comment there is that option, but not in the implementation.I truly enjoy GUI design. The small details that makes you feel happy to use an application. I’m getting there. Show only relevant options. My code is still a bit messy; especially in the
toolbar. Also repeating code...I’m pretty proud about my application so far; most of the GUI is done. Couldn’t write it without your project!
STORAGE:
My idea of storing it in a JSON file has one big disadvantage... When the struct changed in code (adding a new setting), the stored settings cannot be read anymore...
You're right, this can be quite confusing. I decided to make it slightly more descriptive in
037a697c74:I added support for picking folders with file dialogs with the new
folderImporter(similar to the currentfileImporterfor files) inc8ce2cc2fe:I'll keep working on the other issues and let you know once I make progress :)
Thanks again for reporting those problems!
Thanks, these were my biggest showstoppers :-) While there are still many small things left, I'm pretty close to release a FlatPak.
Now I just cut/paste many of my Swift(UI) code and with minor adjustments it works!
btw: I'm surprised about the great performance of GTK; even on macOS.
The word 'keep' sounds a bit strange to me. Maybe just 'cancel' instead? Because the closing of the window will be canceled :-)
No way! I'm definitely going to have to play around with that soon. I'm building a couple document-based apps, and the file format for one of them is a package document, which is a regular directory with some extra metadata. This might be handy...
It’s time to close this issue. With pleasure. I follow the development and great so see some of my issues solved.
The pleasure will goes-on! In 3 months I ported my SwiftUI application to a true and beautiful Adwaita application.
For me, this is the best programming experience in a long, long time. Because its fun, Open Source and still familiar.
While still have a lot to learn I’m behind the stage I have to figure-out how to do to stuff in adwaita-swift.
Now its time to contribute back. While not handy with Git, my first start is to contribute my well-documented code for my Chord provider application; following best practice as much as possible. It’s a neat application! I use it every day as guitar player. I’m proud of it and can be build as
flatpak.I do have a list of issues/suggestions/etc but that is for another issue.
Thanks!
Congratulations! Thank you for sharing the amazing project and helping improve Adwaita for Swift! I‘m looking forward to fixing your list of issues :D