View | Details | Raw Unified | Return to bug 8821
Collapse All | Expand All

(-)src/default.h.orig (+4 lines)
Lines 38-43 Link Here
38
XIV(bool, taskBarShowStartMenu,                 true)
38
XIV(bool, taskBarShowStartMenu,                 true)
39
XIV(bool, taskBarShowWindowListMenu,            true)
39
XIV(bool, taskBarShowWindowListMenu,            true)
40
XIV(bool, taskBarShowWorkspaces,                true)
40
XIV(bool, taskBarShowWorkspaces,                true)
41
XIV(bool, taskBarWorkspacesShowBorders,         true)
42
XIV(bool, taskBarWorkspacesShowNumbers,         true)
41
XIV(bool, taskBarShowWindows,                   true)
43
XIV(bool, taskBarShowWindows,                   true)
42
XIV(bool, taskBarShowShowDesktopButton,         true)
44
XIV(bool, taskBarShowShowDesktopButton,         true)
43
#ifdef CONFIG_TRAY
45
#ifdef CONFIG_TRAY
Lines 247-252 Link Here
247
    OBV("TaskBarMailboxStatusBeepOnNewMail",    &beepOnNewMail,                 "Beep when new mail arrives"),
249
    OBV("TaskBarMailboxStatusBeepOnNewMail",    &beepOnNewMail,                 "Beep when new mail arrives"),
248
    OBV("TaskBarMailboxStatusCountMessages",    &countMailMessages,             "Count messages in mailbox"),
250
    OBV("TaskBarMailboxStatusCountMessages",    &countMailMessages,             "Count messages in mailbox"),
249
    OBV("TaskBarShowWorkspaces",                &taskBarShowWorkspaces,         "Show workspace switching buttons on task bar"),
251
    OBV("TaskBarShowWorkspaces",                &taskBarShowWorkspaces,         "Show workspace switching buttons on task bar"),
252
    OBV("TaskBarWorkspacesShowBorders",         &taskBarWorkspacesShowBorders,  "Draw border around workspace switching buttons"),
253
    OBV("TaskBarWorkspacesShowNumbers",         &taskBarWorkspacesShowNumbers,  "Show number of workspace on workspace switching button"),
250
    OBV("TaskBarShowWindows",                   &taskBarShowWindows,            "Show windows on the taskbar"),
254
    OBV("TaskBarShowWindows",                   &taskBarShowWindows,            "Show windows on the taskbar"),
251
    OBV("TaskBarShowShowDesktopButton",         &taskBarShowShowDesktopButton,  "Show 'show desktop' button on taskbar"),
255
    OBV("TaskBarShowShowDesktopButton",         &taskBarShowShowDesktopButton,  "Show 'show desktop' button on taskbar"),
252
#ifdef CONFIG_TRAY
256
#ifdef CONFIG_TRAY
(-)src/aworkspaces.h.orig (+5 lines)
Lines 22-27 Link Here
22
    virtual YSurface getSurface();
22
    virtual YSurface getSurface();
23
23
24
private:
24
private:
25
    virtual void paint(Graphics &g, const YRect &r);
26
    char *fText;
27
25
    static YTimer *fRaiseTimer;
28
    static YTimer *fRaiseTimer;
26
    long fWorkspace;
29
    long fWorkspace;
27
30
Lines 40-45 Link Here
40
    WorkspacesPane(YWindow *parent);
43
    WorkspacesPane(YWindow *parent);
41
    ~WorkspacesPane();
44
    ~WorkspacesPane();
42
45
46
    void repaint();
47
43
    void configure(const YRect &r, const bool resized);
48
    void configure(const YRect &r, const bool resized);
44
49
45
    WorkspaceButton *workspaceButton(long n);
50
    WorkspaceButton *workspaceButton(long n);
(-)src/aworkspaces.cc.orig (-10 / +98 lines)
Lines 11-16 Link Here
11
#include "wmframe.h"
11
#include "wmframe.h"
12
#include "yrect.h"
12
#include "yrect.h"
13
#include "yicon.h"
13
#include "yicon.h"
14
#include "wmwinlist.h"
14
15
15
#include "intl.h"
16
#include "intl.h"
16
17
Lines 42-52 Link Here
42
43
43
WorkspaceButton::WorkspaceButton(long ws, YWindow *parent): ObjectButton(parent, (YAction *)0)
44
WorkspaceButton::WorkspaceButton(long ws, YWindow *parent): ObjectButton(parent, (YAction *)0)
44
{
45
{
46
    fText = newstr(itoa(ws+1));
45
    fWorkspace = ws;
47
    fWorkspace = ws;
46
    //setDND(true);
48
    //setDND(true);
47
}
49
}
48
50
49
void WorkspaceButton::handleClick(const XButtonEvent &/*up*/, int /*count*/) {
51
void WorkspaceButton::handleClick(const XButtonEvent &up, int /*count*/) {
52
    switch (up.button) {
53
        case 2:
54
            if (windowList)
55
                windowList->showFocused(-1, -1);
56
            break;
57
        case 3:
58
            manager->popupWindowListMenu(this, up.x_root, up.y_root);
59
            break;
60
        case 4:
61
            manager->switchToPrevWorkspace(false);
62
            break;
63
        case 5:
64
            manager->switchToNextWorkspace(false);
65
            break;
66
    }
50
}
67
}
51
68
52
void WorkspaceButton::handleDNDEnter() {
69
void WorkspaceButton::handleDNDEnter() {
Lines 95-115 Link Here
95
        fWorkspaceButton = 0;
112
        fWorkspaceButton = 0;
96
113
97
    if (fWorkspaceButton) {
114
    if (fWorkspaceButton) {
98
        YResourcePaths paths("", false);
99
100
        int ht = 24;
115
        int ht = 24;
101
        int leftX = 0;
116
        int leftX = 0;
102
117
103
        for (w = 0; w < workspaceCount; w++) {
118
        for (w = 0; w < workspaceCount; w++) {
104
            WorkspaceButton *wk = new WorkspaceButton(w, this);
119
            WorkspaceButton *wk = new WorkspaceButton(w, this);
105
            if (wk) {
120
            if (wk) {
106
                ref<YIconImage> image
121
                wk->setSize(ht * desktop->width() / desktop->height(), ht);
107
                    (paths.loadImage("workspace/", workspaceNames[w]));
108
109
                if (image != null)
110
                    wk->setImage(image);
111
                else
112
                    wk->setText(workspaceNames[w]);
113
122
114
                char * wn(newstr(my_basename(workspaceNames[w])));
123
                char * wn(newstr(my_basename(workspaceNames[w])));
115
                char * ext(strrchr(wn, '.'));
124
                char * ext(strrchr(wn, '.'));
Lines 217-220 Link Here
217
#endif
226
#endif
218
}
227
}
219
228
229
void WorkspacesPane::repaint() {
230
    for (int w = 0; w < workspaceCount; w++) {
231
        fWorkspaceButton[w]->repaint();
232
    }
233
}
234
235
void WorkspaceButton::paint(Graphics &g, const YRect &/*r*/) {
236
    int x(0), y(0), w(width()), h(height());
237
238
    if (w > 1 && h > 1) {
239
        YSurface surface(getSurface());
240
        g.setColor(surface.color);
241
        g.drawSurface(surface, x, y, w, h);
242
243
        if (taskBarWorkspacesShowBorders) {
244
            x += 1; y += 1; w -= 2; h -= 2;
245
        }
246
247
        int wx, wy, ww, wh;
248
        int sf = desktop->width() / w;
249
250
        YColor *colors[] = {
251
            surface.color,
252
            surface.color->brighter(),
253
            surface.color->darker(),
254
            getColor(),
255
            getColor()->brighter(),
256
            getColor()->darker()
257
        };
258
259
        for (YFrameWindow *yfw = manager->bottomLayer(WinLayerBelow);
260
                yfw; yfw = yfw->prevLayer()) {
261
            if (yfw->getActiveLayer() > WinLayerDock)
262
                break;
263
            if (yfw->isHidden() || !yfw->visibleOn(fWorkspace))
264
                continue;
265
            wx = yfw->x() / sf + x;
266
            wy = yfw->y() / sf + y;
267
            ww = yfw->width() / sf;
268
            wh = yfw->height() / sf;
269
            if (ww < 1 || wh < 1) {
270
                if (yfw->isRollup()) wh = 1;
271
                else continue;
272
            }
273
            if (yfw->isMinimized()) {
274
                g.setColor(colors[1]);
275
            } else {
276
                if (ww > 2 && wh > 2) {
277
                    if (yfw->focused())
278
                        g.setColor(colors[1]);
279
                    else
280
                        g.setColor(colors[2]);
281
                    g.fillRect(wx+1, wy+1, ww-2, wh-2);
282
                }
283
                g.setColor(colors[5]);
284
            }
285
            g.drawRect(wx, wy, ww-1, wh-1);
286
        }
287
288
        if (taskBarWorkspacesShowBorders) {
289
            g.setColor(surface.color);
290
            g.draw3DRect(x-1, y-1, w+1, h+1, !isPressed());
291
        }
292
293
        if (taskBarWorkspacesShowNumbers) {
294
            ref<YFont> font = getFont();
295
296
            wx = (w - font->textWidth(fText)) / 2 + x;
297
            wy = (h - font->height()) / 2 + font->ascent() + y;
298
299
            g.setFont(font);
300
            g.setColor(colors[0]);
301
            g.drawChars(fText, 0, strlen(fText), wx+1, wy+1);
302
            g.setColor(colors[3]);
303
            g.drawChars(fText, 0, strlen(fText), wx, wy);
304
        }
305
    }
306
}
307
220
#endif
308
#endif
(-)src/wmmgr.cc.orig (+3 lines)
Lines 1674-1679 Link Here
1674
            w->updateLayer();
1674
            w->updateLayer();
1675
        w = w->nextLayer();
1675
        w = w->nextLayer();
1676
    }
1676
    }
1677
    if (taskBar && taskBar->workspacesPane()) {
1678
        taskBar->workspacesPane()->repaint();
1679
    }
1677
}
1680
}
1678
1681
1679
void YWindowManager::restackWindows(YFrameWindow *win) {
1682
void YWindowManager::restackWindows(YFrameWindow *win) {
(-)src/wmstatus.h.orig (-1 / +1 lines)
Lines 15-21 Link Here
15
    virtual void paint(Graphics &g, const YRect &r);
15
    virtual void paint(Graphics &g, const YRect &r);
16
16
17
    void begin();
17
    void begin();
18
    void end() { hide(); }    
18
    void end();
19
19
20
    virtual const char* getStatus() = 0;
20
    virtual const char* getStatus() = 0;
21
21
(-)src/wmstatus.cc.orig (+10 lines)
Lines 20-25 Link Here
20
20
21
#include "intl.h"
21
#include "intl.h"
22
22
23
#include "wmtaskbar.h"
24
#include "aworkspaces.h"
25
23
#include <stdio.h>
26
#include <stdio.h>
24
#include <string.h>
27
#include <string.h>
25
28
Lines 84-89 Link Here
84
    show();
87
    show();
85
}
88
}
86
89
90
void YWindowManagerStatus::end() {
91
    hide();
92
    if (taskBar && taskBar->workspacesPane()) {
93
        taskBar->workspacesPane()->repaint();
94
    }
95
}
96
87
/******************************************************************************/
97
/******************************************************************************/
88
/******************************************************************************/
98
/******************************************************************************/
89
99

Return to bug 8821