Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-02-02 23:47:27

ovc89
Member
Registered: 2021-02-02
Posts: 2

CSS issue creating theme for xfce4-notifyd

So, I'm trying to create a theme for xfce4-notifyd that restricts the size of the contents of any given notification. I'm using text-overflow: ellipsis in an attempt to achieve this, but it seems to break the whole theme down, and it just takes whichever theme I had selected previously. This is the best I've been able to make so far:

#XfceNotifyWindow label#body {
    color: #ffffff;  
    white-space: normal;
    max-width: 240ch;    
    overflow: hidden;
    text-overflow: ellipsis;  
}

Am I missing something? Is this program not compatible with these properties?  Is there something in the program specifically meant to prevent using this type of stuff?

Sorry if the question seems basic, I'm new here.

Offline

#2 2021-02-03 02:24:40

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,415

Re: CSS issue creating theme for xfce4-notifyd

Hello and welcome.

I don't believe gtk3 supports those style properties (see: https://gitlab.gnome.org/GNOME/gtk/-/bl … mpl.c#L820

You might be able to get access to max-width-chars or width-chars using something like:

-GtkLabel-max-width-chars: 50

...but you will need to test that to confirm.

Offline

#3 2021-02-03 03:19:21

ovc89
Member
Registered: 2021-02-02
Posts: 2

Re: CSS issue creating theme for xfce4-notifyd

Hi ToZ,

Those sources do explain a lot. The good news is that the code you sent didn't break anything. The bad news is that it's still not working.

HOWEVER, I looked a bit more through your sources and found this function, and this example. It looks like gtk just has a different way of achieving the same thing. Here's my code so far. Any ideas?


#XfceNotifyWindow label#body {
    color: #ffffff;  
    -GtkLabel-max-width-chars: 10ch;
    -GtkLabel-ellipsize: PANGO_ELLIPSIZE_END;
}

EDIT: I'm seeing that these functions are actually being used in the source code: https://gitlab.xfce.org/apps/xfce4-noti … dow.c#L277

I don't know much about CSS, but it looks to me like I'm just doing something wrong with it...

Last edited by ovc89 (2021-02-03 04:45:00)

Offline

#4 2021-02-03 11:42:50

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,415

Re: CSS issue creating theme for xfce4-notifyd

Correct, they are functions within the code. Sometimes, simple properties like "max-width-chars" might work if they are exposed (I'm not sure). However, if during testing they aren't then you can't use them.

To really accomplish what you are trying to do, you will need to create the functionality in the code of xfce4-notifyd using the GTK code.

As an option/alternative, you might consider using another notification daemon, like dunst. On quick review, it appears it may be able to support what you are trying to do.

Offline

Board footer

Powered by FluxBB