mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 05:48:01 +01:00
Pad workspace name display.
Shift the workspace name, shown when switching workspaces, by 32 pixels. This is purely for aesthetic reasons. It just looks better (IMO) than having the name flush against the screen edge.
This commit is contained in:
committed by
Carlos R. Mafra
parent
1a27b34160
commit
567279b962
@@ -55,6 +55,7 @@
|
|||||||
#include "xinerama.h"
|
#include "xinerama.h"
|
||||||
|
|
||||||
#define MAX_SHORTCUT_LENGTH 32
|
#define MAX_SHORTCUT_LENGTH 32
|
||||||
|
#define WORKSPACE_NAME_DISPLAY_PADDING 32
|
||||||
|
|
||||||
extern WPreferences wPreferences;
|
extern WPreferences wPreferences;
|
||||||
extern XContext wWinContext;
|
extern XContext wWinContext;
|
||||||
@@ -295,12 +296,12 @@ static void showWorkspaceName(WScreen * scr, int workspace)
|
|||||||
head = wGetHeadForPointerLocation(scr);
|
head = wGetHeadForPointerLocation(scr);
|
||||||
rect = wGetRectForHead(scr, head);
|
rect = wGetRectForHead(scr, head);
|
||||||
if (scr->xine_info.count) {
|
if (scr->xine_info.count) {
|
||||||
xx = rect.pos.x + (scr->xine_info.screens[head].size.width - (w+4))/2;
|
xx = rect.pos.x + (scr->xine_info.screens[head].size.width - (w + 4)) / 2;
|
||||||
yy = rect.pos.y + (scr->xine_info.screens[head].size.height - (h+4))/2;
|
yy = rect.pos.y + (scr->xine_info.screens[head].size.height - (h + 4)) / 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xx = (scr->scr_width - (w+4))/2;
|
xx = (scr->scr_width - (w + 4)) / 2;
|
||||||
yy = (scr->scr_height - (h+4))/2;
|
yy = (scr->scr_height - (h + 4)) / 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -311,7 +312,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
|
|||||||
#else
|
#else
|
||||||
px = (scr->scr_width - (w + 4)) / 2;
|
px = (scr->scr_width - (w + 4)) / 2;
|
||||||
#endif
|
#endif
|
||||||
py = 0;
|
py = WORKSPACE_NAME_DISPLAY_PADDING;
|
||||||
break;
|
break;
|
||||||
case WD_BOTTOM:
|
case WD_BOTTOM:
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
@@ -319,23 +320,23 @@ static void showWorkspaceName(WScreen * scr, int workspace)
|
|||||||
#else
|
#else
|
||||||
px = (scr->scr_width - (w + 4)) / 2;
|
px = (scr->scr_width - (w + 4)) / 2;
|
||||||
#endif
|
#endif
|
||||||
py = scr->scr_height - (h + 4);
|
py = scr->scr_height - (h + 4 + WORKSPACE_NAME_DISPLAY_PADDING);
|
||||||
break;
|
break;
|
||||||
case WD_TOPLEFT:
|
case WD_TOPLEFT:
|
||||||
px = 0;
|
px = WORKSPACE_NAME_DISPLAY_PADDING;
|
||||||
py = 0;
|
py = WORKSPACE_NAME_DISPLAY_PADDING;
|
||||||
break;
|
break;
|
||||||
case WD_TOPRIGHT:
|
case WD_TOPRIGHT:
|
||||||
px = scr->scr_width - (w + 4);
|
px = scr->scr_width - (w + 4 + WORKSPACE_NAME_DISPLAY_PADDING);
|
||||||
py = 0;
|
py = WORKSPACE_NAME_DISPLAY_PADDING;
|
||||||
break;
|
break;
|
||||||
case WD_BOTTOMLEFT:
|
case WD_BOTTOMLEFT:
|
||||||
px = 0;
|
px = WORKSPACE_NAME_DISPLAY_PADDING;
|
||||||
py = scr->scr_height - (h + 4);
|
py = scr->scr_height - (h + 4 + WORKSPACE_NAME_DISPLAY_PADDING);
|
||||||
break;
|
break;
|
||||||
case WD_BOTTOMRIGHT:
|
case WD_BOTTOMRIGHT:
|
||||||
px = scr->scr_width - (w + 4);
|
px = scr->scr_width - (w + 4 + WORKSPACE_NAME_DISPLAY_PADDING);
|
||||||
py = scr->scr_height - (h + 4);
|
py = scr->scr_height - (h + 4 + WORKSPACE_NAME_DISPLAY_PADDING);
|
||||||
break;
|
break;
|
||||||
case WD_CENTER:
|
case WD_CENTER:
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user