icewm/src/atasks.cc | 4 +++- icewm/src/atray.cc | 32 ++++++++++++++++++-------------- icewm/src/default.h | 6 ++++++ icewm/src/objbar.cc | 2 +- icewm/src/themable.h | 11 +++++++++++ icewm/src/wmtaskbar.cc | 35 ++++++++++++++++++++++++----------- 6 files changed, 63 insertions(+), 27 deletions(-) diff --git a/icewm/src/atasks.cc b/icewm/src/atasks.cc index 8d213d7..8a038fb 100644 --- a/icewm/src/atasks.cc +++ b/icewm/src/atasks.cc @@ -455,6 +455,8 @@ void TaskPane::relayoutNow() { int rightX = width(); w = (rightX - leftX - 2) / tc; + w -= taskButtonSepSize; + w = (taskButtonWidth && w > taskButtonWidth) ? taskButtonWidth : w; int rem = (rightX - leftX - 2) % tc; x = leftX; h = height(); @@ -473,7 +475,7 @@ void TaskPane::relayoutNow() { f->setGeometry(YRect(x, y, w1, h)); f->show(); x += w1; - x += 0; + x += taskButtonSepSize ; lc++; } else f->hide(); diff --git a/icewm/src/atray.cc b/icewm/src/atray.cc index 5fdfeef..38a1ed3 100644 --- a/icewm/src/atray.cc +++ b/icewm/src/atray.cc @@ -116,29 +116,29 @@ void TrayApp::paint(Graphics &g, const YRect &/*r*/) { } else if (getFrame()->isMinimized()) { bg = minimizedTrayAppBg; fg = minimizedTrayAppFg; - bgPix = taskbuttonminimizedPixmap; + bgPix = trayPanelUseBgPixmaps ? taskbuttonminimizedPixmap : taskbackPixmap; #ifdef CONFIG_GRADIENTS - if (taskMinimizedGradient == null && taskbuttonminimizedPixbuf != null) + if (trayPanelUseBgPixmaps && taskMinimizedGradient == null && taskbuttonminimizedPixbuf != null) taskMinimizedGradient = taskbuttonminimizedPixbuf->scale(sw, sh); - bgGrad = taskMinimizedGradient; + bgGrad = trayPanelUseBgPixmaps ? taskMinimizedGradient : getGradient(); #endif } else if (getFrame()->focused()) { bg = activeTrayAppBg; fg = activeTrayAppFg; - bgPix = taskbuttonactivePixmap; + bgPix = trayPanelUseBgPixmaps ? taskbuttonactivePixmap : taskbackPixmap; #ifdef CONFIG_GRADIENTS - if (taskActiveGradient == null && taskbuttonactivePixbuf != null) + if (trayPanelUseBgPixmaps && taskActiveGradient == null && taskbuttonactivePixbuf != null) taskActiveGradient = taskbuttonactivePixbuf->scale(sw, sh); - bgGrad = taskActiveGradient; + bgGrad = trayPanelUseBgPixmaps ? taskActiveGradient : getGradient(); #endif } else { bg = normalTrayAppBg; fg = normalTrayAppFg; - bgPix = taskbuttonPixmap; + bgPix = trayPanelUseBgPixmaps ? taskbuttonPixmap : taskbackPixmap; #ifdef CONFIG_GRADIENTS - if (taskNormalGradient == null && taskbuttonPixbuf != null) + if (trayPanelUseBgPixmaps && taskNormalGradient == null && taskbuttonPixbuf != null) taskNormalGradient = taskbuttonPixbuf->scale(sw, sh); - bgGrad = taskNormalGradient; + bgGrad = trayPanelUseBgPixmaps ? taskNormalGradient : getGradient(); #endif } @@ -156,7 +156,10 @@ void TrayApp::paint(Graphics &g, const YRect &/*r*/) { else #endif if (bgPix != null) + if (trayPanelUseBgPixmaps) g.fillPixmap(bgPix, 0, 0, width(), height(), 0, 0); + else + g.fillPixmap(bgPix, 0, 0, width(), height(), parent()->x(), parent()->y()); else { g.setColor(bg); g.fillRect(0, 0, width(), height()); @@ -167,7 +170,7 @@ void TrayApp::paint(Graphics &g, const YRect &/*r*/) { ref icon(getFrame()->getIcon()); if (icon != null) { - icon->draw(g, 2, 2, YIcon::smallSize()); + icon->draw(g, (width()-smallIconSize) / 2, (height()-smallIconSize) / 2, smallIconSize); } } @@ -333,7 +336,7 @@ int TrayPane::getRequiredWidth() { for (TrayApp *a(fFirst); a != NULL; a = a->getNext()) if (a->getShown()) tc++; - return (tc ? 4 + tc * (height() - 4) : 1); + return (tc ? tc * height() : 0); } void TrayPane::relayoutNow() { @@ -355,9 +358,10 @@ void TrayPane::relayoutNow() { for (TrayApp *a(fFirst); a != NULL; a = a->getNext()) if (a->getShown()) tc++; - w = h = height() - 4; - x = width() - 2 - tc * w; - y = 2; + w = h = height(); + x = width() - 0 - tc * w; + x = x < 0 ? 0 : x; + y = 0; for (TrayApp *f(fFirst); f != NULL; f = f->getNext()) { if (f->getShown()) { diff --git a/icewm/src/default.h b/icewm/src/default.h index c84c6ea..a290c99 100644 --- a/icewm/src/default.h +++ b/icewm/src/default.h @@ -45,6 +45,9 @@ XIV(bool, taskBarShowStartMenu, true) XIV(bool, taskBarShowWindowListMenu, true) XIV(bool, taskBarShowWorkspaces, true) XIV(bool, taskBarShowWindows, true) +XIV(int, taskBarXPos, 0) +XIV(int, taskBarLength, 0) +XIV(bool, taskBarCentered, false) XIV(bool, taskBarShowShowDesktopButton, true) XIV(int, taskBarButtonWidthDivisor, 3) @@ -281,6 +284,9 @@ cfoption icewm_preferences[] = { OBV("TaskBarShowWindows", &taskBarShowWindows, "Show windows on the taskbar"), OBV("TaskBarShowShowDesktopButton", &taskBarShowShowDesktopButton, "Show 'show desktop' button on taskbar"), OBV("ShowEllipsis", &showEllipsis, "Show Ellipsis in taskbar items"), + OIV("TaskBarXPos", &taskBarXPos, 0, 16383, "Set task bar position, in pixels from the left screen edge"), + OIV("TaskBarLength", &taskBarLength, 0, 16383, "Set task bar length in pixels (0 for full screen)"), + OBV("TaskBarCentered", &taskBarCentered, "Show task bar centered horizontally"), #ifdef CONFIG_TRAY OBV("TaskBarShowTray", &taskBarShowTray, "Show windows in the tray"), OBV("TrayShowAllWindows", &trayShowAllWindows, "Show windows from all workspaces on tray"), diff --git a/icewm/src/objbar.cc b/icewm/src/objbar.cc index d5e85dc..45a776c 100644 --- a/icewm/src/objbar.cc +++ b/icewm/src/objbar.cc @@ -34,7 +34,7 @@ ref toolbuttonPixbuf; ObjectBar::ObjectBar(YWindow *parent): YWindow(parent) { if (bgColor == 0) bgColor = new YColor(clrDefaultTaskBar); - setSize(1, 1); + setSize(0, 0); } ObjectBar::~ObjectBar() { diff --git a/icewm/src/themable.h b/icewm/src/themable.h index e4e23c9..ae3de7c 100644 --- a/icewm/src/themable.h +++ b/icewm/src/themable.h @@ -5,6 +5,11 @@ XIV(bool, prettyClock, true) XIV(bool, rolloverTitleButtons, false) +XIV(int, taskBarHeight, 0) +XIV(int, taskButtonHeight, 0) +XIV(int, taskButtonWidth, 0) +XIV(int, taskButtonSepSize, 0) +XIV(bool, trayPanelUseBgPixmaps, true) XIV(bool, trayDrawBevel, false) XIV(bool, titleBarCentered, false) @@ -157,6 +162,12 @@ cfoption icewm_themable_preferences[] = { #ifndef LITE OBV("RolloverButtonsSupported", &rolloverTitleButtons, "Does it support the 'O' title bar button images (for mouse rollover)"), #endif + OIV("TaskBarHeight", &taskBarHeight, 0, 64, "Taskbar Height (default SmallIconSize + 8)"), + OIV("TaskButtonHeight", &taskButtonHeight, 0, 64, "Height for button elements in taskbar (default TaskBarHeight)"), + OIV("TaskButtonWidth", &taskButtonWidth, 0, 256, "Width for button elements in taskpanel (default taskPanelWidth/TaskbarButtonDivisor )"), + OIV("TaskButtonSeparatorSize", &taskButtonSepSize, 0, 64, "Distance between task buttons (default 0)"), + OBV("TrayPanelUseBgPixmaps", &trayPanelUseBgPixmaps, "TrayPanel will use the some taskbutton[..].xpm pixmaps (default true)"), + OBV("TaskBarClockLeds", &prettyClock, "Task bar clock/APM uses nice pixmapped LCD display (but then it doesn't display correctly in many languages anymore, e.g. for Japanese and Korean it works only when a real font is used and not the LEDs"), OBV("TrayDrawBevel", &trayDrawBevel, "Surround the tray with plastic border"), diff --git a/icewm/src/wmtaskbar.cc b/icewm/src/wmtaskbar.cc index fbf9b37..bd8a626 100644 --- a/icewm/src/wmtaskbar.cc +++ b/icewm/src/wmtaskbar.cc @@ -611,16 +611,16 @@ void TaskBar::updateLayout(int &size_w, int &size_h) { #ifndef NO_CONFIGURE_MENUS { fApplications, true, 1, true, 0, 0, true }, #endif - { fShowDesktop, true, 0, true, 0, 0, true }, + { fShowDesktop, true, 0, true, 0, 0, taskButtonHeight ? false : true }, #ifdef CONFIG_WINMENU - { fWinList, true, 0, true, 0, 0, true}, + { fWinList, true, 0, true, 0, 0, taskButtonHeight ? false : true}, #endif #ifndef NO_CONFIGURE_MENUS - { fObjectBar, true, 1, true, 4, 0, true }, + { fObjectBar, true, 1, true, 4, 0, taskButtonHeight ? false : true }, #endif - { fWorkspaces, taskBarWorkspacesLeft, 0, true, 4, 4, true }, + { fWorkspaces, taskBarWorkspacesLeft, 0, true, 4, 4, taskButtonHeight ? false : true }, - { fCollapseButton, false, 0, true, 0, 2, true }, + { fCollapseButton, false, 0, true, 0, 2, taskButtonHeight ? false : true }, #ifdef CONFIG_APPLET_CLOCK { fClock, false, 1, true, 2, 2, false }, #endif @@ -649,7 +649,7 @@ void TaskBar::updateLayout(int &size_w, int &size_h) { #endif { fDesktopTray, false, 1, true, 1, 1, false }, #ifdef CONFIG_TRAY - { fWindowTray, false, 0, true, 1, 1, true }, + { fWindowTray, false, 0, true, 1, 1, taskButtonHeight ? false : true }, #endif }; const int wcount = sizeof(wlist)/sizeof(wlist[0]); @@ -676,6 +676,8 @@ void TaskBar::updateLayout(int &size_w, int &size_h) { { int dx, dy, dw, dh; manager->getScreenGeometry(&dx, &dy, &dw, &dh); + if (taskBarLength != 0) + dw = taskBarLength; w = dw; } @@ -700,8 +702,12 @@ void TaskBar::updateLayout(int &size_w, int &size_h) { if (h[0] < 16) h[0] = 16; #else + if (taskBarHeight >= smallIconSize) { + h[0] = taskBarHeight; + } else { if (h[0] < YIcon::smallSize() + 8) h[0] = YIcon::smallSize() + 8; + } #endif } @@ -719,8 +725,8 @@ void TaskBar::updateLayout(int &size_w, int &size_h) { if (wl->expand) { yy = y[wl->row]; } else { - hh = wl->w->height(); - yy = y[wl->row] + (h[wl->row] - wl->w->height()) / 2; + hh = taskButtonHeight ? taskButtonHeight : wl->w->height(); + yy = y[wl->row] + (h[wl->row] - hh) / 2; } if (wl->left) { @@ -743,9 +749,9 @@ void TaskBar::updateLayout(int &size_w, int &size_h) { if (taskBarShowWindows) { if (fTasks) { fTasks->setGeometry(YRect(left[0], - y[0], + taskButtonHeight ? y[0] + (h[0] - taskButtonHeight) / 2 : y[0], right[0] - left[0], - h[0])); + taskButtonHeight ? taskButtonHeight : h[0])); fTasks->show(); fTasks->relayout(); } @@ -796,7 +802,14 @@ void TaskBar::updateLocation() { int dx, dy, dw, dh; manager->getScreenGeometry(&dx, &dy, &dw, &dh, -1); - int x = dx; + int x = taskBarCentered ? dx+dw/2-taskBarLength/2 : dx+taskBarXPos; + + if (taskBarLength != 0) + dw = taskBarLength; + else +// to centered full screen taskbar + x = dx; + int y = dy; int w = 0; int h = 0;