!DlltQISlgRGacjtFQD:matrix.org

Relm4

211 Members
Build truly native applications with ease!39 Servers

Load older messages


SenderMessageTime
8 Apr 2024
@quarc:not-a.computerQuARC * I guess I could do it manually with factories or something, I don't really need sorting, but that seems annoying 22:28:30
9 Apr 2024
@quarc:not-a.computerQuARCoh hey, typedcolumnview is brand new, didn't know that05:22:06
@aaron:matrix.aaron-erhardt.deAaron Erhardt

Yes, you can add multiple columns of the same type. The only shortcomming of the current API is that COLUMN_NAME is an associated constant so the column name will always be the same. It should rather be returned by a method of the trait, so the same column type can have different column names if needed.

09:14:15
@quarc:not-a.computerQuARC it also seems like I can't have different LabelColumns of the same type behave differently though, since get_cell_value and format_cell_value are static methods 23:34:55
@quarc:not-a.computerQuARC RelmColumn might not have the same limitation tho, idk 23:35:59
@quarc:not-a.computerQuARC * and it seems like RelmColumn has the same limitation 23:36:37
11 Apr 2024
@chfkch:matrix.orgchfkchIs there a way to have some kind of "dynamic actions"? The case: i want to build a menu to switch between different accounts. The accounts get loaded at the init phase of my app. All i need is to declare actions in to pass a value. I have seen that there are stateful actions with values to pass, but i do not need the state. Should i just use this one and ignore the state part? Also i do not know if i can use the macro in a loop. The examples use it globally once. Or can i get around the macro at all? I have looked a bit at the code of the actions, but i cannot get my head around it yet.19:16:56
@aaron:matrix.aaron-erhardt.deAaron Erhardt

You don't really need state in your actions. The way Relm4 abstracts actions it that you define a type (using either the macro for stateless or stateful actions) and then you register them similar to a signal handler. The type is just there to ensure type-safety btw. because GTK would allow you to pass anything to the action and then you have to cast it and so on.
The state should be stored in your model, which simply receives messages from your actions.
The only reason to store state in an action is to have something like a checkbox created automatically in a menu (for example if you use bool AFAIK). The state then just stores whether the checkbox is ticked or not. You can find such an action in nautilus (Files) in the burger menu as "Show hidden files" for example (the other actions are stateless and therefore don't show a checkbox).

21:26:30
12 Apr 2024
@lewisheart:matrix.orglewisheart joined the room.01:31:27
@chfkch:matrix.orgchfkchah i see, that makes sense.09:43:34
14 Apr 2024
@jacobinski:matrix.orgjacobinski joined the room.02:46:21
@stellarskylark:solarpunk.moe@stellarskylark:solarpunk.moe left the room.05:00:09
@jxbp:crossbach.dejxbp joined the room.09:38:22
@a.atalla:matrix.orgahmed atalla joined the room.22:21:37
15 Apr 2024
@mann2003:matrix.orgmaan2 changed their display name from Manmeet Singh to maan203.15:12:09
@mann2003:matrix.orgmaan2 changed their display name from maan203 to maan2.15:12:13
16 Apr 2024
@a7r7:matrix.orgA7R7 joined the room.02:31:12
@a7r7:matrix.orgA7R7Hi, I'm writing a shell for my hyprland using relm4, which includes double bar. Is there a way to set multiple windows for one app? it seems there can only exist one root per app.03:06:50
@a7r7:matrix.orgA7R7 * Hi, I'm writing a shell for my hyprland using relm4, which includes double bars. Is there a way to set multiple windows for one app? it seems there can only exist one root per app.03:08:37
@aaron:matrix.aaron-erhardt.deAaron Erhardt

See https://github.com/Relm4/Relm4/pull/562

Also, you can always use regular gtk-rs code instead of RelmApp if you need more control. You can have a look at the settings_list example to get an idea how that works.

05:34:02
18 Apr 2024
@chfkch:matrix.orgchfkch

I have a gtk::Box widget where i append a child in my init function https://codeberg.org/Chfkch/bitritter/src/commit/0a6b24a27fb28d06b22c6257d00d403889ece377/src/components/detail.rs#L265
Since this is an EntryRow, i wanted to add_suffix a button, like i usually do in the view! macro.
if i construct a button via

let copy_button = gtk::Button::builder()
                .icon_name(icon_names::COPY_REGULAR)
                .build();

i get an error that the isA<relm::gtk::Widget> is not satisfied.
I noticed the append (IsA<Widget>) and add_suffix (IsA relm4::gtk::Widget ) require different inputs, but i cannot make any sense of it.
I thought a gtk::Button was a gtk::Widget ?

11:12:26
@chfkch:matrix.orgchfkch *

I have a gtk::Box widget where i append a child in my init function https://codeberg.org/Chfkch/bitritter/src/commit/0a6b24a27fb28d06b22c6257d00d403889ece377/src/components/detail.rs#L265
Since this is an EntryRow, i wanted to add_suffix a button, like i usually do in the view! macro.
if i construct a button via

let copy_button = gtk::Button::builder()
                .icon_name(icon_names::COPY_REGULAR)
                .build();

i get an error that the isA<relm::gtk::Widget> is not satisfied.
I noticed the append (IsA<Widget>) and add_suffix (IsA gtk::Widget ) require different inputs, but i cannot make any sense of it.
I thought a gtk::Button was a gtk::Widget ?

11:20:06
@aaron:matrix.aaron-erhardt.deAaron ErhardtThis sounds like you are using a version of libadwaita that's not compatible with the gtk-rs version. Rust usually shows errors like this (when the exact same type or trait is somehow incompatible) when you have the same crate in two different versions in your deps.14:46:14
@chfkch:matrix.orgchfkch
In reply to @aaron:matrix.aaron-erhardt.de
This sounds like you are using a version of libadwaita that's not compatible with the gtk-rs version. Rust usually shows errors like this (when the exact same type or trait is somehow incompatible) when you have the same crate in two different versions in your deps.
Okay i will try to check it. Thanks for the hint.
17:01:45
@chfkch:matrix.orgchfkchI am using 1.4.4 in my dev environment, straight from the GNOME Gitlab (via NixOS). Or is this rather a cargo issue? In my cargo.lock i have version 0.6.0 of libadwaita and libadwaita-sys, which looks like the most recent.17:55:21
@chfkch:matrix.orgchfkchIt looks like only the relm4 crate is dependant on those 2.17:56:15
@aaron:matrix.aaron-erhardt.deAaron Erhardt If you don't have any manual libadwaita or gtk-rs deps in your Cargo.toml you should be fine. Otherwise the version numbers should be 0.6 and 0.8 respectively (and relm4 = "0.8"). 19:58:57
19 Apr 2024
@gabm:matrix.orggabm hey.. i know about grab_focus to catch key events.. how can I drop the focus, for example on input end? 07:24:49
@aaron:matrix.aaron-erhardt.deAaron ErhardtI'm not sure whether that's possible directly. You can of course focus another element afterwards. Maybe someone in the gtk-rs Matrix room knows more...07:48:07
@gabm:matrix.orggabmthx07:50:57

There are no newer messages yet.


Back to Room ListRoom Version: 6