diff --git a/milkwm/wm.c b/milkwm/wm.c index b207ed9..47d8466 100644 --- a/milkwm/wm.c +++ b/milkwm/wm.c @@ -313,8 +313,8 @@ MwWidget wm_frame(int w, int h) { MwAddUserHandler(f->titlebar, MwNmouseDownHandler, drag_down, NULL); f->title = MwVaCreateWidget(MwLabelClass, "title", f->titlebar, 0, 0, 0, 0, - MwNleftPadding, 3, - NULL); + MwNleftPadding, 3, + NULL); MwAddUserHandler(f->title, MwNmouseUpHandler, drag_up, NULL); MwAddUserHandler(f->title, MwNmouseMoveHandler, drag, NULL); MwAddUserHandler(f->title, MwNmouseDownHandler, drag_down, NULL); diff --git a/milkwm/xserver.c b/milkwm/xserver.c index be3f668..1b02456 100644 --- a/milkwm/xserver.c +++ b/milkwm/xserver.c @@ -320,7 +320,7 @@ static void set_name(Window wnd) { unsigned long nitem, after; unsigned char* buf = NULL; Atom atom = XInternAtom(xdisplay, "WM_NAME", False); - Atom utf8 = XInternAtom(xdisplay, "UTF8_STRING", False); + Atom utf8 = XInternAtom(xdisplay, "UTF8_STRING", False); int i; for(i = 0; i < arrlen(windows); i++) { diff --git a/mpanel/CMakeLists.txt b/mpanel/CMakeLists.txt index 479a09f..55b0d74 100644 --- a/mpanel/CMakeLists.txt +++ b/mpanel/CMakeLists.txt @@ -20,6 +20,7 @@ add_subdirectory(separator) add_subdirectory(startbutton) add_subdirectory(time) add_subdirectory(taskbar) +add_subdirectory(launcher) include(GNUInstallDirs) configure_file(mpanelrc.in mpanelrc) diff --git a/mpanel/launcher/CMakeLists.txt b/mpanel/launcher/CMakeLists.txt new file mode 100644 index 0000000..1ac4e11 --- /dev/null +++ b/mpanel/launcher/CMakeLists.txt @@ -0,0 +1,9 @@ +include(MDEBase) +include(MDEPkgConfig) +mde_setup_library(LauncherModule ${CMAKE_INSTALL_LIBDIR}/mpanel) + +target_link_libraries( + LauncherModule + PRIVATE + xemil +) diff --git a/mpanel/launcher/module.c b/mpanel/launcher/module.c new file mode 100644 index 0000000..bb42493 --- /dev/null +++ b/mpanel/launcher/module.c @@ -0,0 +1,43 @@ +#include +#include + +void module(MwWidget box, xl_node_t* node) { + MwWidget f; + xl_node_t* n; + int c; + int w; + int gap = (MwGetInteger(box, MwNheight) - 18 * 2); + + c = 0; + n = node->first_child; + while(n != NULL) { + if(n->type == XL_NODE_NODE && strcmp(n->name, "Execute") == 0 && n->text != NULL) { + c++; + } + + n = n->next; + } + + w = (c + (c % 2)) / 2; + + f = MwVaCreateWidget(MwFrameClass, "launcher", box, 0, 0, 0, 0, + MwNfixedSize, (gap + 18) * w - gap, + NULL); + + c = 0; + n = node->first_child; + while(n != NULL) { + int x = (gap + 18) * (c / 2); + int y = (gap + 18) * (c % 2); + + if(n->type == XL_NODE_NODE && strcmp(n->name, "Execute") == 0 && n->text != NULL) { + MwWidget btn = MwVaCreateWidget(MwButtonClass, "button", f, x, y, 18, 18, + MwNflat, 1, + NULL); + + c++; + } + + n = n->next; + } +} diff --git a/mpanel/mpanelrc.in b/mpanel/mpanelrc.in index 34fa1c1..2955454 100644 --- a/mpanel/mpanelrc.in +++ b/mpanel/mpanelrc.in @@ -8,11 +8,20 @@ - xterm - + uxterm + + + + uxterm + uxterm + uxterm + uxterm + uxterm + +