Only Vertical and SplitVertical gradients are supported,
and only for window.*.title.bg.
Not supported at this time:
- horizontal or diagonal gradients
- gradients for window.*.label.bg, buttons, or menus
- any type of border (raised, sunken, etc.)
This allows users to make the icon in window switcher bigger (or smaller)
than the font size, which enables more Openbox-like appearance.
Example configuration:
osd.window-switcher.item.icon.size: 50
This commit also makes the icon smaller than the font size if the width
allocated with <windowSwitcher><fields><field width=""> is smaller than
that.
as well as 'openbox-3', for example: /usr/share/themes/foo/labwc/themerc
Give 'labwc' higher precedence than 'openbox-3' if both exist.
For several reasons not all themes designed for labwc render well on
Openbox:
1. Labwc support some features like SVG/PNG icons and #rrggbbaa color
definitions which Openbox does not.
2. Openbox generally defaults to black/white colors and will not render
themes accurate without certain options specified in themerc. For
example, in Openbox the following will just render as black:
window.active.title.bg.color: #589bda
...because Openbox defaults the texture to "Gradient Vertical" and
therefore either needs:
window.active.title.bg.colorTo: #3c7cb7
...or remove 'Gradient' from the bg definition and just use something
like:
window.active.title.bg: Flat Border
Whilst none of this is a problem when using labwc, it causes problems for
setups with both Openbox and labwc because themes designed for labwc only
will now show up in obconf, lxappearance, etc causing confusion for users.
- fix that icons for normal/hovered/rounded buttons are not placed
exactly the same position
- fix blurry window button icons in scaled outputs
This commit introduces lab_img and scaled_img_buffer and uses them for
rendering icons in the window titlebar. Now the process of rendering
button icons are split into 2 phases: loading with lab_img_load() and
creating scene-nodes for them with scaled_img_buffer_create(). This
might incur some additional overhead since we no longer preload icon
textures, but the rendering of icon only happens for the first window
as backing buffers are shared and the overhead won't be noticeable.
This commit also simplifies the process of centering icon buffer in the
button, by creating icon buffers in a fixed geometry via
lab_img_render().
For example, variables:
`theme->window_inactive_border_color`
`theme->window_active_border_color`
are converted to:
`theme->window[THEME_INACTIVE].border_color`
`theme->window[THEME_ACTIVE].border_color`
...to replace padding.{width,height} to minimize breaking changes with the
visual appearance of the titlebar.
With the diverging labwc specification for the titlebar (listed below)
we have to choose between (a) not supporting the padding.{width,height}
option which exist in many extant Openbox themes to keep titlebar height
(almost) the same; or (b) making the allocated button areas much smaller
and not keeping the default hover going all the way to the edges. All in
all it just seems a lot simpler and cleaner to break this link to the
openbox spec.
Examples of previous change driving the requirement for this change:
- SVG and PNG support which often results in large icons with hover
effects.
- Theme option window.button.{height,width}
- Larger default areas for icons (26x26)
In way of an example, Numix theme sets a padding.height of 6 which would
have resulted in a titlebar 12px taller without this change.
window.button.{height,width} determine the space allocated for buttons.
Buttons can be smaller than this size and will then just be center aligned
within the allocated space. However, buttons will be clamped at this size
to prevent them from going outside of the allocated space.
- The builtin hover effect is now unrounded when the window is tiled.
- All the corner button icons including ones provided by the user are
now rounded when the window is not tiled.
- Fixed the bug that the window menu button as a fallback of the window
icon is not correctly rounded.
...defined by `<separator label="">`.
Also add the theme option `menu.title.bg.color: #589bda`
The following will be added in separate commits
- menu.title.bg.border.color: #7cb6ec
- menu.title.text.color: #ffffff
- menu.title.text.justify: center
This adds a screen magnifier which can be controlled with the
`ZoomIn` / `ZoomOut` and `ToggleMagnify` actions.
It scales up part of the rendered framebuffer so the magnification
may end up looking blurry depending on the magnification scale.
PR #1774
Add optional drop-shadows to windows using server-side decoration.
Shadows can be enabled/disabled rc.xml and their appearance configured
in themerc. The default is no shadows to preserve current behaviour.
The shadows are drawn in fixed corner and edge buffers shared between
all windows, the edges are scaled to size depending on the size of each
window. Two sets of buffers are used to give the different appearances
for active and inactive windows. I use separate corner/edge buffers for
a few reasons:
- It avoids needing to store a separate large shadow buffer per window
- It avoids needing to redraw the shadows when the window is being
resized
- Compositing the shadows onto the desktop should be faster as there are
overall fewer pixels to blend, and scaling up the edge buffers only
requires reading a tiny buffer which is then replicated.
Filled/outlined rectangles shown as snapping overlay are now enabled/disabled
independently with `snapping.overlay.[region|edge].bg.enabled` and
`snapping.overlay.[region|edge].border.enabled`.
To keep the default behavior, `*.bg.enabled` is yes and `*.border.enabled` is
no for hardware-based renderers, while `*.bg.enabled` is no and
`*.border.enabled` is yes for software-based (pixman) renderer.
Users can now use a filled rectangle as an overlay even with pixman renderer.
However, this may severely impact performance when used with translucent
`snapping.overlay.[region|edge].bg.color`.
This commit includes a refactor to use substruct `theme_snapping_overlay`
inside `theme` in order to pass it to `create_overlay_rect()` in a cleaner way.
Breaking changes is:
- `snapping.overlay.[region|edge].fill` is now removed.
Replace "preview" in rc.xml and themerc with "overlay" since "preview" sounds
like it shows the window content.
Breaking changes are:
- `snapping.preview.*` in themerc is now replaced with `snapping.overlay`.
- `<snapping><preview>` in rc.xml is now replaced with `<snapping><overlay>`.
Add ability to set width with percentage of monitor instead of just pixels.
With this the OSD sizes itself properly on both my 4k and 2k monitors.
example: 50% or 75% instead of 600, max 100%
Some themes don't have hover variants for button pixmaps.
It looks better visually to use the non-hover variants as fallbacks
rather than the built-in 6x6 pixmaps.
...and change default values for the variables below to keep the
window-switcher look the same as it was at the last release.
osd.window-switcher.padding = 4
osd.window-switcher.item.padding.y = 1
osd.window-switcher.item.active.border.width = 2
Made all header files to have LABWC_ prefix in include guard identifers.
Converted from __LABWC_ in 35 include/ files.
Converted from __LAB_ in 5 include/ files.
Added LABWC prefix to 3 include/ files.
Added include guards to 3 include/ files.
The double underscores were removed since according to C standard
those "are always reserved for any use".
Adds two new theme vars:
- menu.width.min (menu will never be smaller than this)
- menu.width.max (menu will never be wider than this + padding)
A fixed menu width can be achieved by setting
menu.width.min == menu.width.max.
Add theme options:
- menu.separator.width
- menu.separator.padding.width
- menu.separator.padding.height
- menu.separator.color
Support separator lines defined by <separator />
Note that separator labels (with text) defined by <separator label="" />
are not supported.