fix(games): size windows to content with edge border; add Games to app-context menu

This commit is contained in:
Luxferre
2026-10-23 16:54:13 +03:00
parent bf4652ca5b
commit 2a12f8bdb4
7 changed files with 19 additions and 17 deletions
Binary file not shown.
+2
View File
@@ -244,6 +244,8 @@ $icon_inf Version^0^sxmo_terminal.sh sxmo_version.sh --block"
WINNAME="${RES%%"$nl"*}" WINNAME="${RES%%"$nl"*}"
CHOICES="${RES#*"$nl"}" CHOICES="${RES#*"$nl"}"
fi fi
CHOICES="$CHOICES
$icon_gam Games^0^sxmo_appmenu.sh games"
;; ;;
esac esac
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -22,8 +22,8 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
static const int WIN_W = 239; static const int WIN_W = 220;
static const int WIN_H = 295; static const int WIN_H = 268;
static const int COLS = 24; static const int COLS = 24;
static const int ROWS = 28; static const int ROWS = 28;
@@ -112,8 +112,8 @@ static unsigned long now_ms() {
} }
static void compute_grid() { static void compute_grid() {
int m = 4; int m = 2;
int topH = 16; // reserved status strip for SCORE/BEST int topH = 14; // reserved status strip for SCORE/BEST
int aw = winW - 2 * m; int aw = winW - 2 * m;
int ah = winH - topH - m; int ah = winH - topH - m;
cell = aw / COLS; cell = aw / COLS;
+5 -5
View File
@@ -23,8 +23,8 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
static const int WIN_W = 239; static const int WIN_W = 224;
static const int WIN_H = 295; static const int WIN_H = 292;
static const int PCOLS = 10; static const int PCOLS = 10;
static const int PROWS = 20; static const int PROWS = 20;
static const int CELL = 14; static const int CELL = 14;
@@ -255,10 +255,10 @@ static void render() {
XSetForeground(dpy, gc, C_BG); XSetForeground(dpy, gc, C_BG);
XFillRectangle(dpy, back, gc, 0, 0, winW, winH); XFillRectangle(dpy, back, gc, 0, 0, winW, winH);
// playfield border (single clean frame around the well) // single border framing the whole game (playfield + side panel) at the
// window edges, so it is visible on all four sides including right/bottom
XSetForeground(dpy, gc, C_DIM); XSetForeground(dpy, gc, C_DIM);
XDrawRectangle(dpy, back, gc, px0 - 1, py0 - 1, PCOLS * CELL + 2, PROWS * CELL + 2); XDrawRectangle(dpy, back, gc, 2, 2, winW - 4, winH - 4);
// settled blocks // settled blocks
for (int x = 0; x < PCOLS; x++) for (int x = 0; x < PCOLS; x++)
for (int y = 0; y < PROWS; y++) for (int y = 0; y < PROWS; y++)