mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-24 01:21:27 +02:00
Compare commits
6 Commits
0526ddfc54
...
258ffc8b97
| Author | SHA1 | Date | |
|---|---|---|---|
| 258ffc8b97 | |||
| 86b7ec1a58 | |||
| 9831e3f72a | |||
| 0a55facac0 | |||
| 0ecf7d3540 | |||
| 4576b5bf1e |
@@ -25,7 +25,52 @@ static unsigned char MENU_SHADE_INDICATOR_XBM_DATA[] = {
|
|||||||
0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
|
#define MENU_SNAP_INDICATOR_W_XBM_SIZE 10
|
||||||
|
#define MENU_SNAP_INDICATOR_H_XBM_SIZE 9
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_V_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x1d, 0x02, 0x1d, 0x02, 0x1d, 0x02, 0x1d, 0x02, 0x1d, 0x02,
|
||||||
|
0x1d, 0x02, 0x1d, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_H_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0x01, 0x02,
|
||||||
|
0x01, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_RH_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0xe1, 0x02, 0xe1, 0x02, 0xe1, 0x02, 0xe1, 0x02,
|
||||||
|
0xe1, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_LH_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0x1d, 0x02, 0x1d, 0x02, 0x1d, 0x02, 0x1d, 0x02,
|
||||||
|
0x1d, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_TH_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0xfd, 0x02, 0xfd, 0x02, 0xfd, 0x02, 0x01, 0x02,
|
||||||
|
0x01, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_BH_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xfd, 0x02, 0xfd, 0x02,
|
||||||
|
0xfd, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_TL_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x1f, 0x02, 0x1f, 0x02, 0x1f, 0x02, 0x01, 0x02, 0x01, 0x02,
|
||||||
|
0x01, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_TR_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0xe1, 0x03, 0xe1, 0x03, 0xe1, 0x03, 0x01, 0x02, 0x01, 0x02,
|
||||||
|
0x01, 0x02, 0x01, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_BL_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x1f, 0x02,
|
||||||
|
0x1f, 0x02, 0x1f, 0x02, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_BR_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xe1, 0x03,
|
||||||
|
0xe1, 0x03, 0xe1, 0x03, 0xff, 0x03 };
|
||||||
|
|
||||||
|
static unsigned char MENU_SNAP_TILED_INDICATOR_XBM_DATA[] = {
|
||||||
|
0xff, 0x03, 0x1f, 0x02, 0x1f, 0x02, 0x1f, 0x02, 0x1f, 0x02, 0x1f, 0x02,
|
||||||
|
0xdf, 0x03, 0xdf, 0x03, 0xff, 0x03 };
|
||||||
|
|
||||||
/* button pixmaps */
|
/* button pixmaps */
|
||||||
/* the first one is for normal state, the second is for when
|
/* the first one is for normal state, the second is for when
|
||||||
|
|||||||
@@ -1383,6 +1383,10 @@ void wShowInfoPanel(WScreen *scr)
|
|||||||
case 32:
|
case 32:
|
||||||
strbuf = wstrappend(strbuf, _("(16 million colors)\n"));
|
strbuf = wstrappend(strbuf, _("(16 million colors)\n"));
|
||||||
break;
|
break;
|
||||||
|
case 30:
|
||||||
|
case 40:
|
||||||
|
strbuf = wstrappend(strbuf, _("(1 billion colors)\n"));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
snprintf(buffer, sizeof(buffer), _("(%d colors)\n"), 1 << scr->w_depth);
|
snprintf(buffer, sizeof(buffer), _("(%d colors)\n"), 1 << scr->w_depth);
|
||||||
strbuf = wstrappend(strbuf, buffer);
|
strbuf = wstrappend(strbuf, buffer);
|
||||||
|
|||||||
+12
-2
@@ -4,6 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||||
* Copyright (c) 1998-2003 Dan Pascu
|
* Copyright (c) 1998-2003 Dan Pascu
|
||||||
|
* Copyright (c) 2009-2023 Window Maker Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -3038,7 +3039,6 @@ void wDockSwap(WDock *dock)
|
|||||||
WAppIcon *btn;
|
WAppIcon *btn;
|
||||||
int x, i;
|
int x, i;
|
||||||
|
|
||||||
|
|
||||||
x = getDockXPosition(scr, dock->on_right_side);
|
x = getDockXPosition(scr, dock->on_right_side);
|
||||||
swapDrawers(scr, x);
|
swapDrawers(scr, x);
|
||||||
dock->x_pos = x;
|
dock->x_pos = x;
|
||||||
@@ -4619,7 +4619,10 @@ static void swapDrawer(WDock *drawer, int new_x)
|
|||||||
ai = drawer->icon_array[i];
|
ai = drawer->icon_array[i];
|
||||||
if (ai == NULL)
|
if (ai == NULL)
|
||||||
continue;
|
continue;
|
||||||
ai->xindex *= -1; /* so A B C becomes C B A */
|
if (drawer->on_right_side)
|
||||||
|
ai->xindex = -abs(ai->xindex);
|
||||||
|
else
|
||||||
|
ai->xindex = abs(ai->xindex);
|
||||||
ai->x_pos = new_x + ai->xindex * ICON_SIZE;
|
ai->x_pos = new_x + ai->xindex * ICON_SIZE;
|
||||||
|
|
||||||
/* Update drawer's tile */
|
/* Update drawer's tile */
|
||||||
@@ -4923,6 +4926,13 @@ static WDock * drawerRestoreState(WScreen *scr, WMPropList *drawer_state)
|
|||||||
drawer->icon_array[drawer->icon_count] = aicon;
|
drawer->icon_array[drawer->icon_count] = aicon;
|
||||||
|
|
||||||
if (aicon) {
|
if (aicon) {
|
||||||
|
/* don't trust the stored direction sign as the dock is
|
||||||
|
* dynamically positioned depending on the screen size
|
||||||
|
*/
|
||||||
|
if (drawer->screen_ptr->dock->on_right_side)
|
||||||
|
aicon->xindex = -abs(aicon->xindex);
|
||||||
|
else
|
||||||
|
aicon->xindex = abs(aicon->xindex);
|
||||||
aicon->dock = drawer;
|
aicon->dock = drawer;
|
||||||
aicon->x_pos = drawer->x_pos + (aicon->xindex * ICON_SIZE);
|
aicon->x_pos = drawer->x_pos + (aicon->xindex * ICON_SIZE);
|
||||||
aicon->y_pos = drawer->y_pos + (aicon->yindex * ICON_SIZE);
|
aicon->y_pos = drawer->y_pos + (aicon->yindex * ICON_SIZE);
|
||||||
|
|||||||
+60
-23
@@ -724,9 +724,12 @@ static void paintEntry(WMenu * menu, int index, int selected)
|
|||||||
/* draw indicator */
|
/* draw indicator */
|
||||||
if (entry->flags.indicator && entry->flags.indicator_on) {
|
if (entry->flags.indicator && entry->flags.indicator_on) {
|
||||||
int iw, ih;
|
int iw, ih;
|
||||||
WPixmap *indicator;
|
WPixmap *indicator = NULL;
|
||||||
|
|
||||||
switch (entry->flags.indicator_type) {
|
switch (entry->flags.indicator_type) {
|
||||||
|
case MI_DIAMOND:
|
||||||
|
indicator = scr->menu_radio_indicator;
|
||||||
|
break;
|
||||||
case MI_CHECK:
|
case MI_CHECK:
|
||||||
indicator = scr->menu_check_indicator;
|
indicator = scr->menu_check_indicator;
|
||||||
break;
|
break;
|
||||||
@@ -739,35 +742,69 @@ static void paintEntry(WMenu * menu, int index, int selected)
|
|||||||
case MI_SHADED:
|
case MI_SHADED:
|
||||||
indicator = scr->menu_shade_indicator;
|
indicator = scr->menu_shade_indicator;
|
||||||
break;
|
break;
|
||||||
case MI_DIAMOND:
|
case MI_SNAP_V:
|
||||||
|
indicator = scr->menu_snap_vertically_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_H:
|
||||||
|
indicator = scr->menu_snap_horizontally_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_RH:
|
||||||
|
indicator = scr->menu_snap_rh_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_LH:
|
||||||
|
indicator = scr->menu_snap_lh_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_TH:
|
||||||
|
indicator = scr->menu_snap_th_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_BH:
|
||||||
|
indicator = scr->menu_snap_bh_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_TL:
|
||||||
|
indicator = scr->menu_snap_tl_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_TR:
|
||||||
|
indicator = scr->menu_snap_tr_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_BL:
|
||||||
|
indicator = scr->menu_snap_bl_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_BR:
|
||||||
|
indicator = scr->menu_snap_br_indicator;
|
||||||
|
break;
|
||||||
|
case MI_SNAP_TILED:
|
||||||
|
indicator = scr->menu_snap_tiled_indicator;
|
||||||
|
break;
|
||||||
|
case MI_NONE:
|
||||||
default:
|
default:
|
||||||
indicator = scr->menu_radio_indicator;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
iw = indicator->width;
|
if (indicator) {
|
||||||
ih = indicator->height;
|
iw = indicator->width;
|
||||||
XSetClipMask(dpy, scr->copy_gc, indicator->mask);
|
ih = indicator->height;
|
||||||
XSetClipOrigin(dpy, scr->copy_gc, 5, y + (h - ih) / 2);
|
XSetClipMask(dpy, scr->copy_gc, indicator->mask);
|
||||||
if (selected) {
|
XSetClipOrigin(dpy, scr->copy_gc, 5, y + (h - ih) / 2);
|
||||||
if (entry->flags.enabled) {
|
if (selected) {
|
||||||
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->select_text_color));
|
if (entry->flags.enabled) {
|
||||||
|
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->select_text_color));
|
||||||
|
} else {
|
||||||
|
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->dtext_color));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->dtext_color));
|
if (entry->flags.enabled) {
|
||||||
}
|
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->mtext_color));
|
||||||
} else {
|
} else {
|
||||||
if (entry->flags.enabled) {
|
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->dtext_color));
|
||||||
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->mtext_color));
|
}
|
||||||
} else {
|
|
||||||
XSetForeground(dpy, scr->copy_gc, WMColorPixel(scr->dtext_color));
|
|
||||||
}
|
}
|
||||||
|
XFillRectangle(dpy, win, scr->copy_gc, 5, y + (h - ih) / 2, iw, ih);
|
||||||
|
/*
|
||||||
|
XCopyArea(dpy, indicator->image, win, scr->copy_gc, 0, 0,
|
||||||
|
iw, ih, 5, y+(h-ih)/2);
|
||||||
|
*/
|
||||||
|
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
|
||||||
}
|
}
|
||||||
XFillRectangle(dpy, win, scr->copy_gc, 5, y + (h - ih) / 2, iw, ih);
|
|
||||||
/*
|
|
||||||
XCopyArea(dpy, indicator->image, win, scr->copy_gc, 0, 0,
|
|
||||||
iw, ih, 5, y+(h-ih)/2);
|
|
||||||
*/
|
|
||||||
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw right text */
|
/* draw right text */
|
||||||
|
|||||||
+18
-6
@@ -23,11 +23,23 @@
|
|||||||
|
|
||||||
#include "wcore.h"
|
#include "wcore.h"
|
||||||
|
|
||||||
#define MI_DIAMOND 0
|
#define MI_NONE 0
|
||||||
#define MI_CHECK 1
|
#define MI_DIAMOND 1
|
||||||
#define MI_MINIWINDOW 2
|
#define MI_CHECK 2
|
||||||
#define MI_HIDDEN 3
|
#define MI_MINIWINDOW 3
|
||||||
#define MI_SHADED 4
|
#define MI_HIDDEN 4
|
||||||
|
#define MI_SHADED 5
|
||||||
|
#define MI_SNAP_V 6
|
||||||
|
#define MI_SNAP_H 7
|
||||||
|
#define MI_SNAP_RH 8
|
||||||
|
#define MI_SNAP_LH 9
|
||||||
|
#define MI_SNAP_TH 10
|
||||||
|
#define MI_SNAP_BH 11
|
||||||
|
#define MI_SNAP_TL 12
|
||||||
|
#define MI_SNAP_TR 13
|
||||||
|
#define MI_SNAP_BL 14
|
||||||
|
#define MI_SNAP_BR 15
|
||||||
|
#define MI_SNAP_TILED 16
|
||||||
|
|
||||||
typedef struct WMenuEntry {
|
typedef struct WMenuEntry {
|
||||||
int order;
|
int order;
|
||||||
@@ -44,7 +56,7 @@ typedef struct WMenuEntry {
|
|||||||
unsigned int enabled:1; /* entry is selectable */
|
unsigned int enabled:1; /* entry is selectable */
|
||||||
unsigned int indicator:1; /* left indicator */
|
unsigned int indicator:1; /* left indicator */
|
||||||
unsigned int indicator_on:1;
|
unsigned int indicator_on:1;
|
||||||
unsigned int indicator_type:3;
|
unsigned int indicator_type:5;
|
||||||
unsigned int editable:1;
|
unsigned int editable:1;
|
||||||
} flags;
|
} flags;
|
||||||
} WMenuEntry;
|
} WMenuEntry;
|
||||||
|
|||||||
+28
-40
@@ -484,45 +484,33 @@ static void createPixmaps(WScreen * scr)
|
|||||||
WPixmap *pix;
|
WPixmap *pix;
|
||||||
|
|
||||||
/* load pixmaps */
|
/* load pixmaps */
|
||||||
pix = wPixmapCreateFromXBMData(scr, (char *)MENU_RADIO_INDICATOR_XBM_DATA,
|
#define LOADPIXMAPINDICATOR(XBM,W,I) {\
|
||||||
(char *)MENU_RADIO_INDICATOR_XBM_DATA,
|
pix = wPixmapCreateFromXBMData(scr, (char *)XBM, (char *)XBM,\
|
||||||
MENU_RADIO_INDICATOR_XBM_SIZE,
|
W, MENU_SNAP_INDICATOR_H_XBM_SIZE,\
|
||||||
MENU_RADIO_INDICATOR_XBM_SIZE, scr->black_pixel, scr->white_pixel);
|
scr->black_pixel, scr->white_pixel);\
|
||||||
if (pix != NULL)
|
if (pix != NULL)\
|
||||||
pix->shared = 1;
|
pix->shared = 1;\
|
||||||
scr->menu_radio_indicator = pix;
|
scr->I = pix;}
|
||||||
|
|
||||||
pix = wPixmapCreateFromXBMData(scr, (char *)MENU_CHECK_INDICATOR_XBM_DATA,
|
LOADPIXMAPINDICATOR(MENU_RADIO_INDICATOR_XBM_DATA, MENU_RADIO_INDICATOR_XBM_SIZE, menu_radio_indicator)
|
||||||
(char *)MENU_CHECK_INDICATOR_XBM_DATA,
|
LOADPIXMAPINDICATOR(MENU_CHECK_INDICATOR_XBM_DATA, MENU_CHECK_INDICATOR_XBM_SIZE, menu_check_indicator)
|
||||||
MENU_CHECK_INDICATOR_XBM_SIZE,
|
LOADPIXMAPINDICATOR(MENU_MINI_INDICATOR_XBM_DATA, MENU_MINI_INDICATOR_XBM_SIZE, menu_mini_indicator)
|
||||||
MENU_CHECK_INDICATOR_XBM_SIZE, scr->black_pixel, scr->white_pixel);
|
LOADPIXMAPINDICATOR(MENU_HIDE_INDICATOR_XBM_DATA, MENU_HIDE_INDICATOR_XBM_SIZE, menu_hide_indicator)
|
||||||
if (pix != NULL)
|
LOADPIXMAPINDICATOR(MENU_SHADE_INDICATOR_XBM_DATA, MENU_SHADE_INDICATOR_XBM_SIZE, menu_shade_indicator)
|
||||||
pix->shared = 1;
|
|
||||||
scr->menu_check_indicator = pix;
|
|
||||||
|
|
||||||
pix = wPixmapCreateFromXBMData(scr, (char *)MENU_MINI_INDICATOR_XBM_DATA,
|
LOADPIXMAPINDICATOR(MENU_SNAP_V_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_vertically_indicator)
|
||||||
(char *)MENU_MINI_INDICATOR_XBM_DATA,
|
LOADPIXMAPINDICATOR(MENU_SNAP_H_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_horizontally_indicator)
|
||||||
MENU_MINI_INDICATOR_XBM_SIZE,
|
LOADPIXMAPINDICATOR(MENU_SNAP_RH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_rh_indicator)
|
||||||
MENU_MINI_INDICATOR_XBM_SIZE, scr->black_pixel, scr->white_pixel);
|
LOADPIXMAPINDICATOR(MENU_SNAP_LH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_lh_indicator)
|
||||||
if (pix != NULL)
|
LOADPIXMAPINDICATOR(MENU_SNAP_TH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_th_indicator)
|
||||||
pix->shared = 1;
|
LOADPIXMAPINDICATOR(MENU_SNAP_BH_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_bh_indicator)
|
||||||
scr->menu_mini_indicator = pix;
|
LOADPIXMAPINDICATOR(MENU_SNAP_TL_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_tl_indicator)
|
||||||
|
LOADPIXMAPINDICATOR(MENU_SNAP_TR_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_tr_indicator)
|
||||||
|
LOADPIXMAPINDICATOR(MENU_SNAP_BL_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_bl_indicator)
|
||||||
|
LOADPIXMAPINDICATOR(MENU_SNAP_BR_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_br_indicator)
|
||||||
|
LOADPIXMAPINDICATOR(MENU_SNAP_TILED_INDICATOR_XBM_DATA, MENU_SNAP_INDICATOR_W_XBM_SIZE, menu_snap_tiled_indicator)
|
||||||
|
|
||||||
pix = wPixmapCreateFromXBMData(scr, (char *)MENU_HIDE_INDICATOR_XBM_DATA,
|
#undef LOADPIXMAPINDICATOR
|
||||||
(char *)MENU_HIDE_INDICATOR_XBM_DATA,
|
|
||||||
MENU_HIDE_INDICATOR_XBM_SIZE,
|
|
||||||
MENU_HIDE_INDICATOR_XBM_SIZE, scr->black_pixel, scr->white_pixel);
|
|
||||||
if (pix != NULL)
|
|
||||||
pix->shared = 1;
|
|
||||||
scr->menu_hide_indicator = pix;
|
|
||||||
|
|
||||||
pix = wPixmapCreateFromXBMData(scr, (char *)MENU_SHADE_INDICATOR_XBM_DATA,
|
|
||||||
(char *)MENU_SHADE_INDICATOR_XBM_DATA,
|
|
||||||
MENU_SHADE_INDICATOR_XBM_SIZE,
|
|
||||||
MENU_SHADE_INDICATOR_XBM_SIZE, scr->black_pixel, scr->white_pixel);
|
|
||||||
if (pix != NULL)
|
|
||||||
pix->shared = 1;
|
|
||||||
scr->menu_shade_indicator = pix;
|
|
||||||
|
|
||||||
create_logo_image(scr);
|
create_logo_image(scr);
|
||||||
|
|
||||||
@@ -1304,8 +1292,11 @@ void ScreenCapture(WScreen *scr, int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
WWindow *wwin;
|
||||||
|
XImage *pimg;
|
||||||
|
|
||||||
case PRINT_WINDOW:
|
case PRINT_WINDOW:
|
||||||
WWindow *wwin = scr->focused_window;
|
wwin = scr->focused_window;
|
||||||
if (wwin && !wwin->flags.shaded) {
|
if (wwin && !wwin->flags.shaded) {
|
||||||
/*
|
/*
|
||||||
* check if hint WM_TAKE_FOCUS is set, if it's the case
|
* check if hint WM_TAKE_FOCUS is set, if it's the case
|
||||||
@@ -1316,7 +1307,6 @@ void ScreenCapture(WScreen *scr, int mode)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* we will only capture the visible window part */
|
/* we will only capture the visible window part */
|
||||||
XImage *pimg;
|
|
||||||
int x_crop = 0;
|
int x_crop = 0;
|
||||||
int y_crop = 0;
|
int y_crop = 0;
|
||||||
int w_crop = wwin->client.width;
|
int w_crop = wwin->client.width;
|
||||||
@@ -1345,8 +1335,6 @@ void ScreenCapture(WScreen *scr, int mode)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PRINT_PARTIAL:
|
case PRINT_PARTIAL:
|
||||||
XImage *pimg;
|
|
||||||
|
|
||||||
pimg = imageCaptureArea(scr);
|
pimg = imageCaptureArea(scr);
|
||||||
if (pimg) {
|
if (pimg) {
|
||||||
img = RCreateImageFromXImage(scr->rcontext, pimg, None);
|
img = RCreateImageFromXImage(scr->rcontext, pimg, None);
|
||||||
|
|||||||
@@ -214,6 +214,18 @@ typedef struct _WScreen {
|
|||||||
struct WPixmap *menu_mini_indicator; /* for miniwindow */
|
struct WPixmap *menu_mini_indicator; /* for miniwindow */
|
||||||
struct WPixmap *menu_hide_indicator; /* for hidden window */
|
struct WPixmap *menu_hide_indicator; /* for hidden window */
|
||||||
struct WPixmap *menu_shade_indicator; /* for shaded window */
|
struct WPixmap *menu_shade_indicator; /* for shaded window */
|
||||||
|
struct WPixmap *menu_snap_vertically_indicator; /* for vertically snap window */
|
||||||
|
struct WPixmap *menu_snap_horizontally_indicator; /* for horizontally snap window */
|
||||||
|
struct WPixmap *menu_snap_rh_indicator; /* for righ half snap window */
|
||||||
|
struct WPixmap *menu_snap_lh_indicator; /* for left half snap window */
|
||||||
|
struct WPixmap *menu_snap_th_indicator; /* for top half snap window */
|
||||||
|
struct WPixmap *menu_snap_bh_indicator; /* for bottom half snap window */
|
||||||
|
struct WPixmap *menu_snap_tl_indicator; /* for top left snap window */
|
||||||
|
struct WPixmap *menu_snap_tr_indicator; /* for top rigt snap window */
|
||||||
|
struct WPixmap *menu_snap_bl_indicator; /* for bottom left snap window */
|
||||||
|
struct WPixmap *menu_snap_br_indicator; /* for bottom right snap window */
|
||||||
|
struct WPixmap *menu_snap_tiled_indicator; /* for tiled window */
|
||||||
|
|
||||||
int app_menu_x, app_menu_y; /* position for application menus */
|
int app_menu_x, app_menu_y; /* position for application menus */
|
||||||
|
|
||||||
struct WMenu *root_menu; /* root window menu */
|
struct WMenu *root_menu; /* root window menu */
|
||||||
|
|||||||
+18
-13
@@ -119,21 +119,22 @@ static const char *const menu_options_entries[] = {
|
|||||||
* Defines the menu entries for the Other maximization sub-menu
|
* Defines the menu entries for the Other maximization sub-menu
|
||||||
*/
|
*/
|
||||||
static const struct {
|
static const struct {
|
||||||
|
unsigned int indicator;
|
||||||
const char *label;
|
const char *label;
|
||||||
unsigned int shortcut_idx;
|
unsigned int shortcut_idx;
|
||||||
int maxim_direction;
|
int maxim_direction;
|
||||||
} menu_maximize_entries[] = {
|
} menu_maximize_entries[] = {
|
||||||
{ N_("Maximize vertically"), WKBD_VMAXIMIZE, MAX_VERTICAL },
|
{ MI_SNAP_V, N_("Vertically"), WKBD_VMAXIMIZE, MAX_VERTICAL },
|
||||||
{ N_("Maximize horizontally"), WKBD_HMAXIMIZE, MAX_HORIZONTAL },
|
{ MI_SNAP_H, N_("Horizontally"), WKBD_HMAXIMIZE, MAX_HORIZONTAL },
|
||||||
{ N_("Maximize left half"), WKBD_LHMAXIMIZE, MAX_VERTICAL | MAX_LEFTHALF },
|
{ MI_SNAP_LH, N_("Left half"), WKBD_LHMAXIMIZE, MAX_VERTICAL | MAX_LEFTHALF },
|
||||||
{ N_("Maximize right half"), WKBD_RHMAXIMIZE, MAX_VERTICAL | MAX_RIGHTHALF },
|
{ MI_SNAP_RH, N_("Right half"), WKBD_RHMAXIMIZE, MAX_VERTICAL | MAX_RIGHTHALF },
|
||||||
{ N_("Maximize top half"), WKBD_THMAXIMIZE, MAX_HORIZONTAL | MAX_TOPHALF },
|
{ MI_SNAP_TH, N_("Top half"), WKBD_THMAXIMIZE, MAX_HORIZONTAL | MAX_TOPHALF },
|
||||||
{ N_("Maximize bottom half"), WKBD_BHMAXIMIZE, MAX_HORIZONTAL | MAX_BOTTOMHALF },
|
{ MI_SNAP_BH, N_("Bottom half"), WKBD_BHMAXIMIZE, MAX_HORIZONTAL | MAX_BOTTOMHALF },
|
||||||
{ N_("Maximize left top corner"), WKBD_LTCMAXIMIZE, MAX_LEFTHALF | MAX_TOPHALF },
|
{ MI_SNAP_TL, N_("Top left"), WKBD_LTCMAXIMIZE, MAX_LEFTHALF | MAX_TOPHALF },
|
||||||
{ N_("Maximize right top corner"), WKBD_RTCMAXIMIZE, MAX_RIGHTHALF | MAX_TOPHALF },
|
{ MI_SNAP_TR, N_("Top right"), WKBD_RTCMAXIMIZE, MAX_RIGHTHALF | MAX_TOPHALF },
|
||||||
{ N_("Maximize left bottom corner"), WKBD_LBCMAXIMIZE, MAX_LEFTHALF | MAX_BOTTOMHALF },
|
{ MI_SNAP_BL, N_("Bottom left"), WKBD_LBCMAXIMIZE, MAX_LEFTHALF | MAX_BOTTOMHALF },
|
||||||
{ N_("Maximize right bottom corner"), WKBD_RBCMAXIMIZE, MAX_RIGHTHALF | MAX_BOTTOMHALF },
|
{ MI_SNAP_BR, N_("Bottom right"), WKBD_RBCMAXIMIZE, MAX_RIGHTHALF | MAX_BOTTOMHALF },
|
||||||
{ N_("Maximus: tiled maximization"), WKBD_MAXIMUS, MAX_MAXIMUS }
|
{ MI_SNAP_TILED, N_("Tiled"), WKBD_MAXIMUS, MAX_MAXIMUS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void updateOptionsMenu(WMenu * menu, WWindow * wwin);
|
static void updateOptionsMenu(WMenu * menu, WWindow * wwin);
|
||||||
@@ -562,6 +563,7 @@ static WMenu *makeOptionsMenu(WScreen * scr)
|
|||||||
static WMenu *makeMaximizeMenu(WScreen * scr)
|
static WMenu *makeMaximizeMenu(WScreen * scr)
|
||||||
{
|
{
|
||||||
WMenu *menu;
|
WMenu *menu;
|
||||||
|
WMenuEntry *entry;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
menu = wMenuCreate(scr, NULL, False);
|
menu = wMenuCreate(scr, NULL, False);
|
||||||
@@ -570,8 +572,11 @@ static WMenu *makeMaximizeMenu(WScreen * scr)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < wlengthof(menu_maximize_entries); i++)
|
for (i = 0; i < wlengthof(menu_maximize_entries); i++) {
|
||||||
wMenuAddCallback(menu, _(menu_maximize_entries[i].label), execMaximizeCommand, NULL);
|
entry = wMenuAddCallback(menu, _(menu_maximize_entries[i].label), execMaximizeCommand, NULL);
|
||||||
|
entry->flags.indicator = entry->flags.indicator_on = 1;
|
||||||
|
entry->flags.indicator_type = menu_maximize_entries[i].indicator;
|
||||||
|
}
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -492,6 +492,9 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array)
|
|||||||
modifiers = ev.xkey.state & w_global.shortcut.modifiers_mask;
|
modifiers = ev.xkey.state & w_global.shortcut.modifiers_mask;
|
||||||
|
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
|
WMScreen *wmscr;
|
||||||
|
WMColor *black;
|
||||||
|
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
if (ev.xkey.keycode == escKey || (wKeyBindings[WKBD_WORKSPACEMAP].keycode != 0 &&
|
if (ev.xkey.keycode == escKey || (wKeyBindings[WKBD_WORKSPACEMAP].keycode != 0 &&
|
||||||
wKeyBindings[WKBD_WORKSPACEMAP].keycode == ev.xkey.keycode &&
|
wKeyBindings[WKBD_WORKSPACEMAP].keycode == ev.xkey.keycode &&
|
||||||
@@ -531,8 +534,8 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
WMScreen *wmscr = wsmap->scr->wmscreen;
|
wmscr = wsmap->scr->wmscreen;
|
||||||
WMColor *black = WMBlackColor(wmscr);
|
black = WMBlackColor(wmscr);
|
||||||
const char *text = "?";
|
const char *text = "?";
|
||||||
WMFont *bold = WMBoldSystemFontOfSize(wmscr, wsmap->mini_workspace_width / 3);
|
WMFont *bold = WMBoldSystemFontOfSize(wmscr, wsmap->mini_workspace_width / 3);
|
||||||
int x = (wsmap->mini_workspace_width / 2) - (WMWidthOfString(bold, text, strlen(text)) / 2);
|
int x = (wsmap->mini_workspace_width / 2) - (WMWidthOfString(bold, text, strlen(text)) / 2);
|
||||||
|
|||||||
+1
-3
@@ -63,8 +63,6 @@ RImage *img;
|
|||||||
Pixmap pix;
|
Pixmap pix;
|
||||||
|
|
||||||
const char *APPNAME = "wmiv";
|
const char *APPNAME = "wmiv";
|
||||||
int APPVERSION_MAJOR = 0;
|
|
||||||
int APPVERSION_MINOR = 7;
|
|
||||||
int NEXT = 0;
|
int NEXT = 0;
|
||||||
int PREV = 1;
|
int PREV = 1;
|
||||||
float zoom_factor = 0;
|
float zoom_factor = 0;
|
||||||
@@ -740,7 +738,7 @@ int main(int argc, char **argv)
|
|||||||
argv[0]);
|
argv[0]);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stderr, "%s version %d.%d\n", APPNAME, APPVERSION_MAJOR, APPVERSION_MINOR);
|
printf("%s version %s\n", APPNAME, VERSION);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
case '?':
|
case '?':
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|||||||
Reference in New Issue
Block a user