Phase 4: SkyKit library + Rigel file manager; fix text centering
SkyKit (skykit/): - Shared palette constants, font setup, and Xlib/Xft drawing utilities - sk_fill, sk_rect, sk_line, sk_text, sk_text_clip, sk_textw, sk_baseline - Builds as libskykit.a, consumed by Rigel and future shell components Rigel (rigel/): - Native C/Xlib file manager with SkyKit - Sidebar with 8 bookmarks (Home, Desktop, Documents, Downloads, etc.) - Editable path bar (Ctrl+L or '/' to activate, Enter to navigate) - Sortable columns: Name / Size / Modified (click header to sort/reverse) - Colored type badges: DIR, IMG, SND, VID, ZIP, SRC, PDF, TXT, EXE - Double-click to open dirs or files (xdg-open) - Keyboard: ↑↓ select, Enter open, Backspace back, Ctrl+H toggle hidden - Right-click menu updated: "File Manager" now launches rigel Text centering fix (deskbar + wm): - Root cause: draw_str added glyph-specific ext.height/ext.y offset, and all callers used hardcoded (H-10)/2 magic numbers instead of font metrics - Fix: draw_str now takes y as a direct baseline; str_baseline() computes (strip_y + strip_h + ascent - descent) / 2 for consistent centering - WM titlebar: same fix using font_title->ascent/descent - Affects: "Orion ▾" button, clock, date, app list, flyout menu items, letter icons, and all window titlebars Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
e3bc761f25
commit
1340bf012c
11 files changed
+1113
-18
No files matched your search
+1
-4
@@ -146,10 +146,7 @@ void frame_draw(WM *wm, Client *c) {
|
||||
xft_color(wm, c->focused ? COLOR_TITLE_TEXT_ACT : COLOR_TITLE_TEXT_INACT, &col_text);
|
||||
XRectangle clip = { BORDER_W + 4, 1, (unsigned short)text_max_w, TITLE_HEIGHT - 2 };
|
||||
XftDrawSetClipRectangles(xd, 0, 0, &clip, 1);
|
||||
XGlyphInfo ext;
|
||||
XftTextExtentsUtf8(wm->dpy, wm->font_title,
|
||||
(const FcChar8 *)c->title, strlen(c->title), &ext);
|
||||
int ty = (TITLE_HEIGHT - ext.height) / 2 + ext.height - ext.y;
|
||||
int ty = (TITLE_HEIGHT + wm->font_title->ascent - wm->font_title->descent) / 2;
|
||||
XftDrawStringUtf8(xd, &col_text, wm->font_title,
|
||||
BORDER_W + 6, ty,
|
||||
(const FcChar8 *)c->title, strlen(c->title));
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
static const MenuItem MENU_ITEMS[] = {
|
||||
{ "App Launcher", "orionlauncher &" },
|
||||
{ "Terminal", "alacritty &" },
|
||||
{ "File Manager", "thunar &" },
|
||||
{ "File Manager", "rigel &" },
|
||||
{ "Text Editor", "mousepad &" },
|
||||
{ "──────────────────", NULL },
|
||||
{ "Web Browser", "firefox &" },
|
||||
|
||||
Reference in new issue
Block a user