mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
Info Panel size with variables
This patch uses two variables to set the width and the height for the Info Panel. Now the panel has the same size than the window. Finally, this patch moves the center definition to the beginning, and removes the curly brackets. Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
This commit is contained in:
committed by
Carlos R. Mafra
parent
b565b48b92
commit
5ed02b58be
19
src/dialog.c
19
src/dialog.c
@@ -1123,17 +1123,19 @@ static void destroyInfoPanel(WCoreWindow *foo, void *data, XEvent *event)
|
|||||||
thePanel = NULL;
|
thePanel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wShowInfoPanel(WScreen * scr)
|
void wShowInfoPanel(WScreen *scr)
|
||||||
{
|
{
|
||||||
|
const int win_width = 382;
|
||||||
|
const int win_height = 230;
|
||||||
InfoPanel *panel;
|
InfoPanel *panel;
|
||||||
WMPixmap *logo;
|
WMPixmap *logo;
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
char *strbuf = NULL;
|
char *name, *strbuf = NULL;
|
||||||
const char *separator;
|
const char *separator;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
const char *name;
|
|
||||||
Window parent;
|
Window parent;
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
WMPoint center;
|
||||||
char **strl;
|
char **strl;
|
||||||
int i, width = 50, sepHeight;
|
int i, width = 50, sepHeight;
|
||||||
char *visuals[] = {
|
char *visuals[] = {
|
||||||
@@ -1158,7 +1160,7 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
panel->scr = scr;
|
panel->scr = scr;
|
||||||
|
|
||||||
panel->win = WMCreateWindow(scr->wmscreen, "info");
|
panel->win = WMCreateWindow(scr->wmscreen, "info");
|
||||||
WMResizeWidget(panel->win, 390, 230);
|
WMResizeWidget(panel->win, win_width, win_height);
|
||||||
|
|
||||||
logo = WMCreateApplicationIconBlendedPixmap(scr->wmscreen, (RColor *) NULL);
|
logo = WMCreateApplicationIconBlendedPixmap(scr->wmscreen, (RColor *) NULL);
|
||||||
if (!logo) {
|
if (!logo) {
|
||||||
@@ -1329,17 +1331,14 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
WMRealizeWidget(panel->win);
|
WMRealizeWidget(panel->win);
|
||||||
WMMapSubwidgets(panel->win);
|
WMMapSubwidgets(panel->win);
|
||||||
|
|
||||||
parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 382, 230, 0, 0, 0);
|
parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, win_width, win_height, 0, 0, 0);
|
||||||
|
|
||||||
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
|
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
|
||||||
|
|
||||||
WMMapWidget(panel->win);
|
WMMapWidget(panel->win);
|
||||||
|
|
||||||
{
|
center = getCenter(scr, win_width, win_height);
|
||||||
WMPoint center = getCenter(scr, 382, 230);
|
wwin = wManageInternalWindow(scr, parent, None, _("Info"), center.x, center.y, win_width, win_height);
|
||||||
|
|
||||||
wwin = wManageInternalWindow(scr, parent, None, _("Info"), center.x, center.y, 382, 230);
|
|
||||||
}
|
|
||||||
|
|
||||||
WSETUFLAG(wwin, no_closable, 0);
|
WSETUFLAG(wwin, no_closable, 0);
|
||||||
WSETUFLAG(wwin, no_close_button, 0);
|
WSETUFLAG(wwin, no_close_button, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user