mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-29 09:52:29 +01:00
fixed some bugs in menu editor
This commit is contained in:
@@ -437,12 +437,13 @@ createPanel(_Panel *p)
|
|||||||
|
|
||||||
pix = WMGetPixmapXID(pixm);
|
pix = WMGetPixmapXID(pixm);
|
||||||
|
|
||||||
XDrawLine(dpy, pix, WMColorGC(black), 1, 0, 6, 3);
|
XDrawLine(dpy, pix, WMColorGC(black), 0, 3, 6, 3);
|
||||||
XDrawLine(dpy, pix, WMColorGC(black), 1, 6, 6, 3);
|
XDrawLine(dpy, pix, WMColorGC(black), 3, 0, 3, 6);
|
||||||
|
/*
|
||||||
XDrawLine(dpy, pix, WMColorGC(black), 1, 0, 3, 3);
|
XDrawLine(dpy, pix, WMColorGC(black), 1, 0, 3, 3);
|
||||||
XDrawLine(dpy, pix, WMColorGC(black), 1, 6, 3, 3);
|
XDrawLine(dpy, pix, WMColorGC(black), 1, 6, 3, 3);
|
||||||
XDrawLine(dpy, pix, WMColorGC(black), 0, 0, 0, 6);
|
XDrawLine(dpy, pix, WMColorGC(black), 0, 0, 0, 6);
|
||||||
|
*/
|
||||||
|
|
||||||
pix = WMGetPixmapMaskXID(pixm);
|
pix = WMGetPixmapMaskXID(pixm);
|
||||||
|
|
||||||
@@ -452,11 +453,8 @@ createPanel(_Panel *p)
|
|||||||
XFillRectangle(dpy, pix, gc, 0, 0, 7, 7);
|
XFillRectangle(dpy, pix, gc, 0, 0, 7, 7);
|
||||||
|
|
||||||
XSetForeground(dpy, gc, 1);
|
XSetForeground(dpy, gc, 1);
|
||||||
XDrawLine(dpy, pix, gc, 1, 0, 6, 3);
|
XDrawLine(dpy, pix, gc, 0, 3, 6, 3);
|
||||||
XDrawLine(dpy, pix, gc, 1, 6, 6, 3);
|
XDrawLine(dpy, pix, gc, 3, 0, 3, 6);
|
||||||
XDrawLine(dpy, pix, gc, 1, 0, 3, 3);
|
|
||||||
XDrawLine(dpy, pix, gc, 1, 6, 3, 3);
|
|
||||||
XDrawLine(dpy, pix, gc, 0, 0, 0, 6);
|
|
||||||
|
|
||||||
panel->markerPix[ExternalInfo] = pixm;
|
panel->markerPix[ExternalInfo] = pixm;
|
||||||
panel->markerPix[PipeInfo] = pixm;
|
panel->markerPix[PipeInfo] = pixm;
|
||||||
@@ -582,6 +580,7 @@ createPanel(_Panel *p)
|
|||||||
data->param.pipe.command = "wmconfig --output wmaker";
|
data->param.pipe.command = "wmconfig --output wmaker";
|
||||||
|
|
||||||
data = putNewItem(panel, pad, DirectoryInfo, _("Themes"));
|
data = putNewItem(panel, pad, DirectoryInfo, _("Themes"));
|
||||||
|
data->param.directory.command = "setstyle";
|
||||||
data->param.directory.directory = "/usr/share/WindowMaker/Themes /usr/local/share/WindowMaker/Themes $HOME/GNUstep/Library/WindowMaker/Themes";
|
data->param.directory.directory = "/usr/share/WindowMaker/Themes /usr/local/share/WindowMaker/Themes $HOME/GNUstep/Library/WindowMaker/Themes";
|
||||||
data->param.directory.stripExt = 1;
|
data->param.directory.stripExt = 1;
|
||||||
|
|
||||||
@@ -839,6 +838,21 @@ createPanel(_Panel *p)
|
|||||||
WMSetButtonText(panel->quickB, _("Do not confirm action."));
|
WMSetButtonText(panel->quickB, _("Do not confirm action."));
|
||||||
WMSetButtonAction(panel->quickB, buttonClicked, panel);
|
WMSetButtonAction(panel->quickB, buttonClicked, panel);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
label = WMCreateLabel(panel->optionsF);
|
||||||
|
WMResizeWidget(label, width - 20, FRAME_HEIGHT - 50);
|
||||||
|
WMMoveWidget(label, 10, 20);
|
||||||
|
WMSetLabelText(label,
|
||||||
|
_("Instructions:\n\n"
|
||||||
|
" - drag items from the left to the menu to add new items\n"
|
||||||
|
" - drag items out of the menu to remove items\n"
|
||||||
|
" - drag items in menu to change their position\n"
|
||||||
|
" - double click in a menu item to change the label\n"
|
||||||
|
" - click on a menu item to change related information"));
|
||||||
|
|
||||||
|
|
||||||
WMRealizeWidget(panel->frame);
|
WMRealizeWidget(panel->frame);
|
||||||
WMMapSubwidgets(panel->frame);
|
WMMapSubwidgets(panel->frame);
|
||||||
WMMapWidget(panel->frame);
|
WMMapWidget(panel->frame);
|
||||||
@@ -851,6 +865,7 @@ createPanel(_Panel *p)
|
|||||||
}
|
}
|
||||||
changedItemPad(panel->typeP, panel);
|
changedItemPad(panel->typeP, panel);
|
||||||
|
|
||||||
|
panel->sections[NoInfo][0] = label;
|
||||||
|
|
||||||
panel->sections[ExecInfo][0] = panel->commandF;
|
panel->sections[ExecInfo][0] = panel->commandF;
|
||||||
panel->sections[ExecInfo][1] = panel->shortF;
|
panel->sections[ExecInfo][1] = panel->shortF;
|
||||||
@@ -1104,24 +1119,22 @@ changeInfoType(_Panel *panel, char *title, InfoType type)
|
|||||||
|
|
||||||
if (panel->currentType != type) {
|
if (panel->currentType != type) {
|
||||||
|
|
||||||
if (panel->currentType != NoInfo) {
|
w = panel->sections[panel->currentType];
|
||||||
w = panel->sections[panel->currentType];
|
|
||||||
|
|
||||||
while (*w) {
|
while (*w) {
|
||||||
WMUnmapWidget(*w);
|
WMUnmapWidget(*w);
|
||||||
w++;
|
w++;
|
||||||
}
|
|
||||||
WMUnmapWidget(panel->paramF);
|
|
||||||
WMUnmapWidget(panel->quickB);
|
|
||||||
}
|
}
|
||||||
|
WMUnmapWidget(panel->paramF);
|
||||||
|
WMUnmapWidget(panel->quickB);
|
||||||
|
|
||||||
if (type != NoInfo) {
|
|
||||||
w = panel->sections[type];
|
|
||||||
|
|
||||||
while (*w) {
|
|
||||||
WMMapWidget(*w);
|
w = panel->sections[type];
|
||||||
w++;
|
|
||||||
}
|
while (*w) {
|
||||||
|
WMMapWidget(*w);
|
||||||
|
w++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1281,8 +1294,14 @@ static void menuItemEdited(struct WEditMenuDelegate *delegate, WEditMenu *menu,
|
|||||||
WEditMenuItem *item)
|
WEditMenuItem *item)
|
||||||
{
|
{
|
||||||
_Panel *panel = (_Panel*)delegate->data;
|
_Panel *panel = (_Panel*)delegate->data;
|
||||||
|
WEditMenu *submenu;
|
||||||
|
|
||||||
updateFrameTitle(panel, WGetEditMenuItemTitle(item), panel->currentType);
|
updateFrameTitle(panel, WGetEditMenuItemTitle(item), panel->currentType);
|
||||||
|
|
||||||
|
submenu = WGetEditMenuSubmenu(menu, item);
|
||||||
|
if (submenu) {
|
||||||
|
WSetEditMenuTitle(submenu, WGetEditMenuItemTitle(item));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -695,8 +695,7 @@ Initialize(WMScreen *scr)
|
|||||||
InitWorkspace(scr, WPrefs.win);
|
InitWorkspace(scr, WPrefs.win);
|
||||||
InitConfigurations(scr, WPrefs.win);
|
InitConfigurations(scr, WPrefs.win);
|
||||||
|
|
||||||
changeSection(NULL, InitMenu(scr, WPrefs.win));
|
InitMenu(scr, WPrefs.win);
|
||||||
return;
|
|
||||||
|
|
||||||
#ifdef not_yet_fully_implemented
|
#ifdef not_yet_fully_implemented
|
||||||
InitKeyboardSettings(scr, WPrefs.win);
|
InitKeyboardSettings(scr, WPrefs.win);
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ WCreateEditMenuItem(WMWidget *parent, char *title, Bool isTitle)
|
|||||||
return iPtr;
|
return iPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *WGetEditMenuItemTitle(WEditMenuItem *item)
|
char *WGetEditMenuItemTitle(WEditMenuItem *item)
|
||||||
{
|
{
|
||||||
return item->label;
|
return item->label;
|
||||||
@@ -299,6 +298,8 @@ destroyEditMenuItem(WEditMenuItem *iPtr)
|
|||||||
free(iPtr->label);
|
free(iPtr->label);
|
||||||
if (iPtr->data && iPtr->destroyData)
|
if (iPtr->data && iPtr->destroyData)
|
||||||
(*iPtr->destroyData)(iPtr->data);
|
(*iPtr->destroyData)(iPtr->data);
|
||||||
|
if (iPtr->submenu)
|
||||||
|
WMDestroyWidget(iPtr->submenu);
|
||||||
|
|
||||||
free(iPtr);
|
free(iPtr);
|
||||||
}
|
}
|
||||||
@@ -550,7 +551,10 @@ WSetEditMenuTitle(WEditMenu *mPtr, char *title)
|
|||||||
|
|
||||||
free(item->label);
|
free(item->label);
|
||||||
item->label = wstrdup(title);
|
item->label = wstrdup(title);
|
||||||
|
|
||||||
updateMenuContents(mPtr);
|
updateMenuContents(mPtr);
|
||||||
|
|
||||||
|
WMRedisplayWidget(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -764,6 +768,9 @@ updateMenuContents(WEditMenu *mPtr)
|
|||||||
if (mPtr->maxSize.height)
|
if (mPtr->maxSize.height)
|
||||||
newH = WMIN(newH, mPtr->maxSize.height);
|
newH = WMIN(newH, mPtr->maxSize.height);
|
||||||
|
|
||||||
|
if (W_VIEW(mPtr)->size.width == newW && mPtr->view->size.height == newH+1)
|
||||||
|
return;
|
||||||
|
|
||||||
W_ResizeView(mPtr->view, newW, newH+1);
|
W_ResizeView(mPtr->view, newW, newH+1);
|
||||||
|
|
||||||
if (mPtr->closeB)
|
if (mPtr->closeB)
|
||||||
|
|||||||
Reference in New Issue
Block a user