This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 84727563f95ce166453bdee833539dedb3ea6b95 (commit)
via c7c0b43629c3b4fd31d659ae0ee5d9355ff76b5b (commit)
from ac33bb9d1b52def5bc9b8349010e208a7c850e22 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/wmaker-crm.git/commit/84727563f95ce166453bdee833539dedb3ea6b95
commit 84727563f95ce166453bdee833539dedb3ea6b95
Author: Doug Torrance <[email protected]>
Date: Wed Jan 20 23:19:04 2016 -0500
wmaker: Implement basic menu shading.
Menus may now be shaded like other windows by double clicking on their title
bars. Note that, even if animations are enabled, the shade animation seen
with other windows does not work for menus.
This fixes Debian bug #72038 [1]:
From: Chris Pimlott <[email protected]>
Subject: wmaker: Persistant menus should be shade-able
Date: Tue, 19 Sep 2000 14:04:41 -0400
One of the many little things that makes me appreciate Window
Maker is that by clicking on the title bar of a menu, it can be made
"persistant" so it stays on screen and doesn't dissappear after click or
mouseout like normal. I find it useful if I need to run a number of
commands in a submenu, or for keeping a list of open windows on
screen.
The usefulness of this feature could be extended by allowing menus
to be shaded (by double-clicking the title) like normal windows, thus
collapsing them to take up less space when not needed but still be
persistant. Perhaps other commands of windows (like maximizing/
minimizing, resizing) might be considered as well, although
personally only shading stands out as particularly useful for menus.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=72038
diff --git a/src/menu.c b/src/menu.c
index 83eb804..cc4d737 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -182,6 +182,7 @@ WMenu *wMenuCreate(WScreen *screen, const char *title, int
main_menu)
menu->frame->child = menu;
menu->flags.lowered = 0;
+ menu->flags.shaded = 0;
/* create borders */
if (title) {
@@ -1114,6 +1115,12 @@ void wMenuUnmap(WMenu * menu)
menu->flags.mapped = 0;
menu->flags.open_to_left = 0;
+ if (menu->flags.shaded) {
+ wFrameWindowResize(menu->frame, menu->frame->core->width,
menu->frame->top_width +
+ menu->entry_height*menu->entry_no +
menu->frame->bottom_width - 1);
+ menu->flags.shaded = 0;
+ }
+
for (i = 0; i < menu->cascade_no; i++) {
if (menu->cascades[i] != NULL
&& menu->cascades[i]->flags.mapped &&
!menu->cascades[i]->flags.buttoned) {
@@ -2103,6 +2110,15 @@ static void menuTitleDoubleClick(WCoreWindow * sender,
void *data, XEvent * even
lower = 1;
}
changeMenuLevels(menu, lower);
+ } else {
+ if (menu->flags.shaded) {
+ wFrameWindowResize(menu->frame,
menu->frame->core->width, menu->frame->top_width +
+ menu->entry_height*menu->entry_no +
menu->frame->bottom_width - 1);
+ menu->flags.shaded = 0;
+ } else {
+ wFrameWindowResize(menu->frame,
menu->frame->core->width, menu->frame->top_width - 1);
+ menu->flags.shaded = 1;
+ }
}
}
diff --git a/src/menu.h b/src/menu.h
index e568a7e..547f051 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -99,6 +99,7 @@ typedef struct WMenu {
unsigned int jump_back_pending:1;
unsigned int inside_handler:1;
+ unsigned int shaded:1;
} flags;
} WMenu;
http://repo.or.cz/wmaker-crm.git/commit/c7c0b43629c3b4fd31d659ae0ee5d9355ff76b5b
commit c7c0b43629c3b4fd31d659ae0ee5d9355ff76b5b
Author: Doug Torrance <[email protected]>
Date: Wed Jan 20 23:19:03 2016 -0500
wmaker: Fix whitespace in menu.h; passes checkpatch.pl inspection.
diff --git a/src/menu.h b/src/menu.h
index 45525eb..e568a7e 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -30,76 +30,76 @@
#define MI_SHADED 4
typedef struct WMenuEntry {
- int order;
- char *text; /* entry text */
- char *rtext; /* text to show in the right part */
- void (*callback)(struct WMenu *menu, struct WMenuEntry *entry);
- void (*free_cdata)(void *data); /* proc to be used to free clientdata */
- void *clientdata; /* data to pass to callback */
- int cascade; /* cascade menu index */
+ int order;
+ char *text; /* entry text */
+ char *rtext; /* text to show in the right part */
+ void (*callback)(struct WMenu *menu, struct WMenuEntry *entry);
+ void (*free_cdata)(void *data); /* proc to be used to free
clientdata */
+ void *clientdata; /* data to pass to callback */
+ int cascade; /* cascade menu index */
#ifdef USER_MENU
- WMPropList *instances; /* allowed instances */
+ WMPropList *instances; /* allowed instances */
#endif /* USER_MENU */
- struct {
- unsigned int enabled:1; /* entry is selectable */
- unsigned int indicator:1; /* left indicator */
- unsigned int indicator_on:1;
- unsigned int indicator_type:3;
- unsigned int editable:1;
- } flags;
+ struct {
+ unsigned int enabled:1; /* entry is selectable */
+ unsigned int indicator:1; /* left indicator */
+ unsigned int indicator_on:1;
+ unsigned int indicator_type:3;
+ unsigned int editable:1;
+ } flags;
} WMenuEntry;
typedef struct WMenu {
- struct WMenu *parent;
- struct WMenu *brother;
-
- time_t timestamp; /* for the root menu. Last time
- * menu was reloaded */
-
- /* decorations */
- struct WFrameWindow *frame;
- WCoreWindow *menu; /* the window menu */
- Pixmap menu_texture_data;
- int frame_x, frame_y; /* position of the frame in root*/
-
- WMenuEntry **entries; /* array of entries. This is shared
- * by the menu and it's "brother" */
- short alloced_entries; /* number of entries allocated in
- * entry array */
- struct WMenu **cascades; /* array of cascades */
- short cascade_no;
-
- short entry_no; /* number of entries */
- short selected_entry;
-
- short entry_height; /* height of each entry */
-
- WMHandlerID timer; /* timer for the autoscroll */
-
- void *jump_back; /* jump back data */
-
- /* to be called when some entry is edited */
- void (*on_edit)(struct WMenu *menu, struct WMenuEntry *entry);
- /* to be called when destroyed */
- void (*on_destroy)(struct WMenu *menu);
-
- struct {
- unsigned int titled:1;
- unsigned int realized:1; /* whether the window was configured */
- unsigned int app_menu:1; /* this is a application or root menu */
- unsigned int mapped:1; /* if menu is already mapped on screen*/
- unsigned int buttoned:1; /* if the close button is visible
- * (menu was torn off) */
- unsigned int open_to_left:1; /* direction to open submenus */
- unsigned int lowered:1;
-
- unsigned int brother:1; /* if this is a copy of the
menu*/
- unsigned int editing:1;
- unsigned int jump_back_pending:1;
-
- unsigned int inside_handler:1;
- } flags;
+ struct WMenu *parent;
+ struct WMenu *brother;
+
+ time_t timestamp; /* for the root menu. Last time
+ * menu was reloaded */
+
+ /* decorations */
+ struct WFrameWindow *frame;
+ WCoreWindow *menu; /* the window menu */
+ Pixmap menu_texture_data;
+ int frame_x, frame_y; /* position of the frame in root*/
+
+ WMenuEntry **entries; /* array of entries. This is shared
+ * by the menu and it's "brother" */
+ short alloced_entries; /* number of entries allocated in
+ * entry array */
+ struct WMenu **cascades; /* array of cascades */
+ short cascade_no;
+
+ short entry_no; /* number of entries */
+ short selected_entry;
+
+ short entry_height; /* height of each entry */
+
+ WMHandlerID timer; /* timer for the autoscroll */
+
+ void *jump_back; /* jump back data */
+
+ /* to be called when some entry is edited */
+ void (*on_edit)(struct WMenu *menu, struct WMenuEntry *entry);
+ /* to be called when destroyed */
+ void (*on_destroy)(struct WMenu *menu);
+
+ struct {
+ unsigned int titled:1;
+ unsigned int realized:1; /* whether the window was
configured */
+ unsigned int app_menu:1; /* this is a application or root
menu */
+ unsigned int mapped:1; /* if menu is already mapped on
screen*/
+ unsigned int buttoned:1; /* if the close button is visible
+ * (menu was torn off) */
+ unsigned int open_to_left:1; /* direction to open submenus */
+ unsigned int lowered:1;
+
+ unsigned int brother:1; /* if this is a copy of the
menu*/
+ unsigned int editing:1;
+ unsigned int jump_back_pending:1;
+
+ unsigned int inside_handler:1;
+ } flags;
} WMenu;
@@ -107,15 +107,15 @@ void wMenuPaint(WMenu *menu);
void wMenuDestroy(WMenu *menu, int recurse);
void wMenuRealize(WMenu *menu);
WMenuEntry *wMenuInsertCascade(WMenu *menu, int index, const char *text,
- WMenu *cascade);
+ WMenu *cascade);
WMenuEntry *wMenuInsertCallback(WMenu *menu, int index, const char *text,
- void (*callback)(WMenu *menu, WMenuEntry
*entry),
- void *clientdata);
+ void (*callback)(WMenu *menu, WMenuEntry
*entry),
+ void *clientdata);
void wMenuEntrySetCascade(WMenu *menu, WMenuEntry *entry, WMenu *cascade);
-#define wMenuAddCallback(menu, text, callback, data) \
- wMenuInsertCallback(menu, -1, text, callback, data)
+#define wMenuAddCallback(menu, text, callback, data) \
+ wMenuInsertCallback(menu, -1, text, callback, data)
void wMenuRemoveItem(WMenu *menu, int index);
-----------------------------------------------------------------------
Summary of changes:
src/menu.c | 16 +++++++
src/menu.h | 139 +++++++++++++++++++++++++++++++------------------------------
2 files changed, 86 insertions(+), 69 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].