After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347965 - The pager widget themeing should be better
The pager widget themeing should be better
Status: RESOLVED OBSOLETE
Product: libwnck
Classification: Core
Component: pager
git master
Other Linux
: Normal normal
: 2.20.x
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-18 21:56 UTC by Benjamin Otte (Company)
Modified: 2018-01-24 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add themeing support for the pager (17.96 KB, patch)
2006-07-18 21:58 UTC, Benjamin Otte (Company)
none Details | Review
simple gtkrc for playing with this patch (272 bytes, text/plain)
2006-07-18 22:20 UTC, Benjamin Otte (Company)
  Details
proof of concept screenshot (8.50 KB, image/png)
2006-07-20 16:13 UTC, Benjamin Otte (Company)
  Details

Description Benjamin Otte (Company) 2006-07-18 21:56:54 UTC
Currently the pager widget is not very themeable. It uses some of the theme's colors, but does not use gtk_paint_* functions for rendering.
This makes it hard to really change the appearance of the pager.
Comment 1 Benjamin Otte (Company) 2006-07-18 21:58:06 UTC
Created attachment 69140 [details] [review]
add themeing support for the pager
Comment 2 Benjamin Otte (Company) 2006-07-18 22:17:36 UTC
The applied patch changes the rendering to use this rendering model (beware of ascii art):
+---------+    +---------+
| padding |    | padding |
| +-----+ |    | +-----+ |
| | con | |    | |     | |
| |tent | |    | |     | |
| +-----+ |    | +-----+ |
|         |    |         |
+---------+    +---------+
          spacing
+---------+    +---------+
|         |    |         |
| +-----+ |    | +-----+ |
| |     | |    | |     | |
| |     | |    | |     | |
| +-----+ |    | +-----+ |
|         |    |         |
+---------+    +---------+
The image shows a 2x2 pager, as you can clearly see.

Every workspace background is drawn with gtk_paint_flat_box, including the padding. The style is determined as:
SELECTED, if the workspace is the currently selected workspace
PRELIGHT, if the mouse is hovering above this workspace
NORMAL,   otherwise
The detail string is set to "workspace"

After this, the padding is subtracted and the windows are placed inside the resulting box according to how they appear on screen.
Every window is drawn using gtk_paint_box with a shadow type of ETCHED_OUT. The style is determined as:
ACTIVE,  if the window is currently active
SELECTED, if the window is on the currently selected workspace
PRELIGHT, if the mouse is hovering above this window's workspace
NORMAL,   otherwise
The detail string is set to "window" or "translucent-window" if the window is supposed to be drawn translucent. This is currently done only for a window that is currently dragged with the mouse.

The following style properties were added to WnckPager for this:
horizontal-spacing (int, default: 1)
  horizontal space between two adjacent workspaces 
vertical-spacing (int, default: 1)
  vertical space between two adjacent workspaces 
horizontal-padding (int, default: 0)
  horizontal padding on a workspace 
vertical-padding (int, default: 0)
  vertical padding on a workspace
themed (boolean, default FALSE or 0)
  must be set to TRUE to enable the themed code

IMPORTANT:
since the themeing would break the rendering of the pager using current themes, the themed option has to be set to true. This ensures that the theme has been specifically updated for the pager.
All changes in these patch are 100% backwards compatible. They are supposed to not have any visual effect on current themes at all.
Comment 3 Benjamin Otte (Company) 2006-07-18 22:20:38 UTC
Created attachment 69142 [details]
simple gtkrc for playing with this patch

use the gtkrc like this:
#libwnck> GTK2_RC_FILES=./gtkrc libwnck/test-pager
Comment 4 Benjamin Otte (Company) 2006-07-20 16:13:51 UTC
Created attachment 69265 [details]
proof of concept screenshot

Just for Vincent, her is a proof-of-concept screenshot.

It shows:
- translucency (the workspace areas are semi-transparent)
- spacing (3 pixels between workspaces)
- padding (1 pixel border at every workspace)
Comment 5 Vincent Untz 2006-10-01 10:17:18 UTC
This is 2.17 material. We should look at this soon :-)

Elijah: I'm slightly concerned by the fact the all changes we do in libwnck need to be ported to metacity. Would it be possible to move all relevant functions in some files and copy & paste them? (I guess making metacity use libwnck wouldn't solve this since it's mainly about private symbols)
Comment 6 Elijah Newren 2006-10-01 19:30:47 UTC
There's unfortunately a number of things that need to be kept in sync; right-click-window-menu (either from titlebar or tasklist) including translations, look of the pager, and probably a few other things.  It seems the two codes have diverged a fair amount over time too, which sucks.  I'd be in favor of some kind of general cleanup which gets some common files, where we mark the metacity copy with "WARNING: someone will just overwrite this with the libwnck version so don't change this one" and then just does copy & paste from libwnck to metacity.
Comment 7 Vincent Untz 2007-06-29 17:53:33 UTC
From #gnome-art:

19:32 < thos> vuntz, i'm not sure how seperate horizontal and verical paddings and spacing makes sense
19:32 < thos> vuntz, since the theme doesn't know if the pager is horizontal or vertical
19:38 < vuntz> thos: I guess the goal here was to have different paddings/spacings since the width and height are not equal
19:38 < benzea> hm, not sure what kind of things make sense there from a theme, but it sounds good in general
19:38 < vuntz> (and the workspace representation is never rotated, so you always end up with width being horizontal, even if the 
               pager is rotated)
19:38 < benzea> but you can't make any assumptions about the width and height from the theme
19:39 < benzea> hm, ok maybe then you can :-)
19:39 < vuntz> well, your screen can be rotated on tablet PC, so... :-)
19:39 < vuntz> you can't assume width > height
19:45 < vuntz> benzea, thos: so, you'd say "go for it" for this pager patch? (well, after determining if seperate horizontal and 
               vertical paddings/spacings make sense)
19:50 < benzea> sure
19:50 < benzea> hm, add an icon padding option maybe
19:52 < vuntz> ok, thanks

Benjamin: do you have time to update your patch to trunk? If no, I'll try to do this myself...
Comment 8 Benjamin Otte (Company) 2007-07-01 16:19:23 UTC
I don't think I'll want to checkout a Gnome build environment and update it as I'm currently busy with Swfdec and aKademy. If updating the patch to trunk is hard, I'd suggest doing it at Guadec.

As for the vertical/horizontal split, I'm not really sure what my reasoning for this was. I'm pretty sure there was one, or I wouldn't have done the work. But it could have been just something as consistency. But I wouldn't have made extra work for fun...
Comment 9 Vincent Untz 2007-07-02 11:52:48 UTC
(In reply to comment #8)
> I don't think I'll want to checkout a Gnome build environment and update it as
> I'm currently busy with Swfdec and aKademy. If updating the patch to trunk is
> hard, I'd suggest doing it at Guadec.

I don't think it's hard, but I might not have time before GUADEC, so...
Comment 10 GNOME Infrastructure Team 2018-01-24 13:34:02 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libwnck/issues/67.