Skip to content

Commit

Permalink
Add ColorQuickSwitchBorder themable preference for issue #736.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Feb 17, 2025
1 parent 570af33 commit 8878930
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
19 changes: 12 additions & 7 deletions man/icewm-preferences.pod
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,13 @@ B<WM_CLASS> to allow B<runonce> for B<NetStatusCommand>.

Command to run for address bar entries.

=item B<InputIgnorePrefix>="nohup|(nice[[:space:]]+-n[[:space:]]*[[:digit:]]+)|sudo|(LANG|LC_[[:alnum:]]]*)(=|=[^[:space:]]+)"

Regular expression (POSIX Extended flavor) which marks the begin of a
command line in command input fields. Such prefixes are ignored while
the auto-completion action is performed, typically for commands acting
as pass-through wrapper, executing the specified command.

=back

=head2 WINDOW MENUS
Expand Down Expand Up @@ -1201,13 +1208,6 @@ Dimension of the large icons.

Dimension of the large icons.

=item B<InputIgnorePrefix>="nohup|(nice[[:space:]]+-n[[:space:]]*[[:digit:]]+)|sudo|(LANG|LC_[[:alnum:]]]*)(=|=[^[:space:]]+)"

Regular expression (POSIX Extended flavor) which marks the begin of a
command line in command input fields. Such prefixes are ignored while
the auto-completion action is performed, typically for commands acting
as pass-through wrapper, executing the specified command.

=item B<QuickSwitchHorzMargin>=3 [0-64]

Horizontal margin of the quickswitch window.
Expand Down Expand Up @@ -1549,6 +1549,11 @@ Text color in the quick switch window.

Rectangle around the active icon in the quick switch window.

=item B<ColorQuickSwitchBorder> = ""

The color for the quick switch border. When empty, a one pixel wide
elevation border will be drawn, based on the quick switch background.

=item B<ColorDefaultTaskBar> = "rgb:C0/C0/C0"

Background of the taskbar.
Expand Down
2 changes: 2 additions & 0 deletions src/themable.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ XSV(const char *, clrMoveSizeStatus, "rgb:C0/C0/C0")
XSV(const char *, clrMoveSizeStatusText, "rgb:00/00/00")
XSV(const char *, clrQuickSwitch, "rgb:C0/C0/C0")
XSV(const char *, clrQuickSwitchText, "rgb:00/00/00")
XSV(const char *, clrQuickSwitchBorder, 0)
XSV(const char *, clrQuickSwitchActive, 0)
XSV(const char *, clrDefaultTaskBar, "rgb:C0/C0/C0")
XSV(const char *, clrNormalButton, "rgb:C0/C0/C0")
Expand Down Expand Up @@ -260,6 +261,7 @@ cfoption icewm_themable_preferences[] = {
OSV("ColorMoveSizeStatusText", &clrMoveSizeStatusText, "Text color of move/resize status window"),

OSV("ColorQuickSwitch", &clrQuickSwitch, "Background of the quick switch window"),
OSV("ColorQuickSwitchBorder", &clrQuickSwitchBorder, "Border color of the quick switch window"),
OSV("ColorQuickSwitchText", &clrQuickSwitchText, "Text color in the quick switch window"),
OSV("ColorQuickSwitchActive", &clrQuickSwitchActive, "Rectangle arround the active icon in the quick switch window"),
OSV("ColorDefaultTaskBar", &clrDefaultTaskBar, "Background of the taskbar"),
Expand Down
17 changes: 12 additions & 5 deletions src/wmswitch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ SwitchWindow::SwitchWindow(YWindow *parent, ISwitchItems *items,
fWorkspace(WorkspaceInvalid),
switchFg(&clrQuickSwitchText),
switchBg(&clrQuickSwitch),
switchBc(&clrQuickSwitchBorder),
switchHl(&clrQuickSwitchActive),
switchMfg(&clrActiveTitleBarText),
switchFont(switchFontName),
Expand Down Expand Up @@ -597,16 +598,22 @@ void SwitchWindow::paint(Graphics &g, const YRect &/*r*/) {
fGradient = switchbackPixbuf->scale(width() - 2, height() - 2);
}

g.setColor(switchBg);
g.drawBorderW(0, 0, width() - 1, height() - 1, true);
if (switchBc) {
g.setColor(switchBc);
g.drawRect(0, 0, width() - 1, height() - 1);
} else {
g.setColor(switchBg);
g.drawBorderW(0, 0, width() - 1, height() - 1, true);
}

if (fGradient != null)
g.drawImage(fGradient, 1, 1, width() - 2, height() - 2, 1, 1);
else
if (switchbackPixmap != null)
else if (switchbackPixmap != null)
g.fillPixmap(switchbackPixmap, 1, 1, width() - 3, height() - 3);
else
else {
g.setColor(switchBg);
g.fillRect(1, 1, width() - 3, height() - 3);
}

m_verticalStyle ? paintVertical(g) : paintHorizontal(g);
}
Expand Down
1 change: 1 addition & 0 deletions src/wmswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class SwitchWindow: public YPopupWindow {

YColorName switchFg;
YColorName switchBg;
YColorName switchBc;
YColorName switchHl;
YColorName switchMbg;
YColorName switchMfg;
Expand Down

0 comments on commit 8878930

Please sign in to comment.