draft: Migrate Dissent to UI files#372
Conversation
+ Revamped login page
Some notesThe adw.ToggleGroup, used in the login page has landed in Libadwaita 1.7, which is not usable through the gotk4-adwaita go package (yet). For now, the compilation is failing because I compile the 1.7 branch of this package locally during build |
|
|
||
| func LoadStyles(cssFile string) error { | ||
| display := gdk.DisplayGetDefault() | ||
| if display == nil { | ||
| return errors.New("Unable to apply " + cssFile + " : Could not get default display") | ||
| } | ||
| provider := gtk.NewCSSProvider() | ||
| provider.LoadFromResource(resourcePath + "/" + cssFile) | ||
|
|
||
| gtk.StyleContextAddProviderForDisplay(display, provider, uint(gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)) | ||
| return nil | ||
| } |
There was a problem hiding this comment.
This part of the gresources package could be moved to your CSSUtil subpackage, with the help of GoTKit!3 (for the GResource support)
| /* dimensions.go */ | ||
| /* Use of CSS Variables makes migration impossible */ |
There was a problem hiding this comment.
This CSS fragment cannot be moved to styles.css because of CSS Templating (from cssutil), until GoTKit!3 (for the CSS Template support that you provide) got merged
|
This so far looks great to me; thank you for the work! Dissent utilizes This goes for the embed viewer too, especially when GTK's video player is broken for streaming files (and therefore downloading in general) and doesn't implement GIF rendering at all. Could we maybe look to migrate some of these to #356 or some other component libraries as well? |
|
Also the new UI designs for the login page and the profile viewer look awesome! I've been meaning to do exactly that myself, so this is perfect. |
The UI files are used to simplify the UI building where it can be simplified. If it adds up complexity, you can just leave a blank space, assign an id to the parent element and add the missing part from the code 😃 |
Right, this is mostly about this PR and how it's going to handle onlineimage components, since I noticed it primarily uses gtk.Images. If the PR keeps the onlineimage and embed components as it is right now, then I'm happy with it. |
| // TODO : ABSOLUTE MESS TO REFACTOR | ||
| type channelIndexItem interface { | ||
| String() string | ||
| ChannelID() discord.ChannelID | ||
| Row(context.Context) *gtk.ListBoxRow | ||
| } | ||
| type guildIndexItem interface { | ||
| String() string | ||
| GuildID() discord.GuildID | ||
| QSItem(context.Context) *gtk.Button | ||
| } | ||
|
|
||
| type indexItems []indexItem | ||
| type guildIndexItems []guildIndexItem | ||
| type channelIndexItems []channelIndexItem | ||
|
|
||
| func (its guildIndexItems) String(i int) string { return its[i].String() } | ||
| func (its guildIndexItems) Len() int { return len(its) } | ||
|
|
||
| func (its channelIndexItems) String(i int) string { return its[i].String() } | ||
| func (its channelIndexItems) Len() int { return len(its) } | ||
|
|
||
| func (its indexItems) String(i int) string { return its[i].String() } | ||
| func (its indexItems) Len() int { return len(its) } | ||
| // ======================== |
There was a problem hiding this comment.
This part of the code can be improved I guess...
we may want to fill it with cool things, right?)
|
For the craziest of you, guys, here's a nightly build: It has been compressed twice in order to contains more than 100Mb in only 25Mb (the actual limit of GitHub) |
New feature coming in this MR: Tabs overviewUseful for mobile navigation and streamlines with what have been seen in other libadwaita apps
Some adjustments for mobile users:
@diamondburned I've seen that you wanted to use the AdwTabOverview by merging the sidebar into the AdwTabPage [1] Well, my implementation does not requires that (for now at least). |
|
Some news about this port: I have revamped the sidebar! It removes the buttons in the header bar and make everything more mobile-friendly! The description of the channel is also partially visible in the header, and the message summaries are more readable thanks to all the space available in the sidebar:
|
|
This looks really good! |
|
The changes are now too big for an easy merge, so there will be a phase where I will resolve all the various conflicts, fix the translations, add comments,... And first of all, I think I will need your help to know if the coding style is compliant with what you expect, because once merged, I will be less active in this project I guess |










Hi everyone!
It's been a long time, but I resumed my work on porting the app to Gtk.Builder
This would bring various advantages, especially for design: The static interface organization (pieces of the UI that will not be dynamically generated) can be crafted and edited through a UI designer app: Cambalache
But what it means, technically?
It means that the code has been severely simplified! Just look at the login component file
The way to use UI elements has changed, too:
Instead of manually creating elements:
You'll do this instead:
Tip
If you've just created the file, you'd need to add it to the gresource index (
/uifiles/uifiles.gresource.xml):Tip
Conventionnally, the root object is named
rootContentWhat's also included in this PR
As a PoC, I have migrated and redesigned the login page, to make it more GNOME-ish (opinionated choice, I know... 😬)
Capture.video.du.2025-11-16.16-10-16.mp4
What do you think?