Style-Class Attribute is missing.

Bug #1716254 reported by Saint Itch on 2017-09-10
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Xpad
Low
Arthur Borsboom

Bug Description

In case of Gtk3 theming, there are IDs, which represent the corresponding note you've taken. This gives nice possibilities with theming in case of organisation. But there is no Style-Class, which let's you distinct between XPads TextView and all other. So please add a Style-Class as XpadPad so we can theme it as what it is: a note TextView.

As example for what we need:
textview.XpadPad text selection {}

Should be darn easy.
Best regards.

Tags: ui Edit Tag help
Saint Itch (saint.itch) on 2017-09-10
tags: added: ui
tags: added: gtk
removed: ui
tags: added: theming
removed: gtk
tags: added: ui
removed: theming
description: updated
description: updated
Saint Itch (saint.itch) on 2017-09-10
description: updated

Hi Saint Itch,

Your request sounds logical and I don't mind to add it.

I am a pretty new to GTK theming by CSS (I just recently changed Xpad to CSS theming in GTK), so I need a bit of time to figure it out.

Just to help me, do you know a way how I can verify if I have implemented it correctly? :)

Changed in xpad:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Arthur Borsboom (arthurborsboom)
milestone: none → 5.1.0
Saint Itch (saint.itch) wrote :

Hi and sure.

I just started Gtk3 theming some weeks ago, because it's possible at all, now.
The easiest way to test it is, via the new Gtk Inspector. Yes, _the_ must have
tool and as far as i remember already installed with the libs or another package.

It needs to be activated anyway, as mentioned here:
[Gtk3 Inspector](https://wiki.gnome.org/Projects/GTK+/Inspector)

To recite:
 * Activation run: "gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true"
 * Launching Start and focus the App and press Control-Shift-I or Control-Shift-D.
               or
               run: "GTK_DEBUG=interactive xpad"

In the then appearing window tap on the "CSS" button and enter the following code:

textview text {
 color: #ffffff;
 background-color: #0000ff;
 background-image: none;
}

This one should work already. Now try the application specific version (case sensitiv):

textview.XpadPad text {
 color: #ffffff;
 background-color: #0000ff;
 background-image: none;
}

If this works, the work is done.

Btw, as i am new to theming as well, i just figured that object denotation is not set
as id. Am still confused by the inspector, at least a bit. I might mention that i have
no clue about gtk in any way. *g* Let me mention the following:

If i look at the inspector, i see an object for every open note. It's denoation is it's
name, which is the first line within the note. Already figured that out. If you'd set
this denoation as id, different note could be adressed by CSS as well. Like so:

textview#tasks-today text {
 color: #ffffff;
 background-color: #0000ff;
 background-image: none;
}

/* Am not sure if the "-" causes problems. */

I must admit, that this would require everyone to have the same name/denotaition or to
theme themselves.

Best regards.

Saint Itch (saint.itch) wrote :

Have a look at this picture to see what i mean by denotation:
http://storage3.static.itmages.com/i/17/0911/h_1505162947_5629682_16e4b186d0.png

Awesome! I couldn't have asked for more. :)

I believe you provided me with all I need.
Now I just need to find a good moment in silence to actually do it. ;-)

You request is on the radar.

I have added the following CSS Style classes to Xpad.

XpadPad
XpadPadProperties
XpadPreferences
XpadTextView
XpadToolbar

Following your example, this CSS would color the complete pad.

textview.XpadTextView, text {
 color: #ffffff;
 background-color: #0000ff;
 background-image: none;
}

Would you mind to test this by the develepment branch?
This is how to obtain and test the branch.

Install bzr and development tools/packages, such as intltool, make, etc.
bzr branch lp:xpad (get a copy of the source code to your local system)
cd xpad
./autogen.sh
./configure
make
cd src
./xpad

If the version number in Xpad (Help -> About) is v5.1, you did it right. :-)

Wolfgang Rohm (wgrm) wrote :

Well, i upgraded my Debian VM, since it still has been 8.x and istalled the needed packages. But i cant pull the source. Either i only get the meta folder or the following error:

bzr: ERROR: Unprintable exception LockContention: dict={'msg': IOError(37, 'Keine Sperren verf\xc3\xbcgbar'), 'lock': u'/home/username/src/xpad/.bzr/checkout/dirstate'}, fmt='Could not acquire lock "%(lock)s": %(msg)s', error=UnicodeDecodeError('ascii', '[Errno 37] Keine Sperren verf\xc3\xbcgbar', 29, 30, 'ordinal not in range(128)')

I'll have another try later.

Wolfgang Rohm (wgrm) wrote :

Ok, so i found the time to test again and this time it worked.
It seems that bzr doesn't like NFS mounted homes.

I firstly checked for the Style-Classes:
XpadPad
XpadToolbar
XpadTextView

They work nicely and contain something, which i would have
asked for next time, presumably. The XpadToolbar Style-Class!
With this it is now possible to remove - the for me most
disturbing factor - from XPad; the toolbar color. Try:

textview.XpadTextView, text {
 color: #787878;
 background-color: #f8efc5;
 background-image: none;
}

toolbar.XpadToolbar {
 color: #787878;
 background-color: #f8efc5;
 background-image: none;
}

That's professional theming!

Since it's all Gtk i assume XpadPreferences and
XpadPadProperties to work as well without any problem-
They are Style-Classes only, after all. :)

Although i can't imagine a reasonable possibility to use them
within a theme, since these ones are dialogs and should be theme-
defaults, it doesn't hurt to leave them in as well. You never know.

I like it! Thanks for your fast response. :)

Wolfgang Rohm (wgrm) wrote :

This is quite off topic, but i merged two accounts successfully,
but the alias is still visible - with my first carma - and i can't
find a place to contact with this problem. Any ideas?

Wolfgang Rohm (wgrm) wrote :

Done

Off topic: so, Saint Itch and Wolgang are the same person and all is fixed? :)

On topic: Apparantly the suggested solution works for you? If so, it will be included in the next release of Xpad, which will be version 5.1.

Changed in xpad:
status: Confirmed → Fix Committed
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers