Commit Graph

170 Commits

Author SHA1 Message Date
dc4962a6c4 Fix icon Y positioning: offset by icon height to align bottom with baseline
- drawPng uses top-left corner, drawText uses baseline
- Icon bottom (Y=42) now aligns with baseline at Y=42
- Icon top is at Y=26 (42-16), occupies Y=26 to Y=42
2026-05-10 07:32:15 -04:00
1416e2db26 Move icon Y position from +20 to +32 DP below filename
- Icon was overlapping the first row of status bar
- Increased vertical spacing to avoid overlap
2026-05-10 07:14:20 -04:00
fdd1e841ae Use original iconY position (30 DP) without offset
- User confirmed icon showed up at this position
- Icon renders in second row of status bar as intended
2026-05-10 07:12:49 -04:00
28c7253622 Fix icon path and Y positioning
- Read icons/cut.png (not cut.png) to match embed directive
- Offset icon Y by iconSize so bottom aligns with text baseline
- drawText uses baseline positioning, drawPng uses top-left corner
2026-05-10 07:10:02 -04:00
f259145084 Fix icon Y positioning: offset by icon height to align bottom with baseline
- drawText positions glyphs by baseline, drawPng uses top-left corner
- Subtract iconSize from iconY so icon bottom aligns with text baseline
- Icon now renders within status bar instead of overlapping top
2026-05-10 07:03:43 -04:00
0ac2941802 Replace unicode cut icon with PNG icon in StatusBar
- Load cut.png from embedded filesystem
- drawStatusBar uses drawPng() for cut icon (16dp)
- No other files modified
2026-05-10 06:52:54 -04:00
106e91832a Add drawPng function to Renderer for PNG icon rendering
- Takes image.Image, position (x,y) in Dp, size (width,height) in Dp
- Tint color with alpha < 255 applies color overlay using clip.Rect
- Converts Dp to pixels using Renderer.toPx()
- Uses paint.NewImageOp for image rendering
2026-05-10 06:50:03 -04:00
fe3e7c3d75 Revert to last working state (68437c3) before PNG icon changes 2026-05-10 06:45:47 -04:00
1b1cf51528 Remove search/conflict icon references — only cut/copy/paste exist
- StatusBar now only draws cut, copy, paste PNG icons
- Removed code that tried to draw non-existent search.png and conflict.png
2026-05-10 06:39:22 -04:00
d2509123b0 Replace Unicode icons with PNG icons in StatusBar
- Move icons/ to internal/ui/icons/ for go:embed
- Renderer.loadIcons() loads PNGs from embedded filesystem
- drawStatusBar() uses drawPng() for cut/copy/paste/search/conflict icons
- Icons are 16dp, rendered from 48x48 PNGs (2x density)
2026-05-10 06:29:19 -04:00
14284afa73 Add drawPng function to Renderer for PNG icon rendering
- Takes image.Image, position (x,y) in Dp, size (width,height) in Dp
- Tint color with alpha < 255 applies color overlay using clip.Rect
- Converts Dp to pixels using Renderer.toPx()
- Uses paint.NewImageOp for image rendering
2026-05-10 06:26:29 -04:00
a065ee979d Add PNG icon assets (48x48, 2x density for 24dp icons)
- copy.png, cut.png, paste.png generated from SVGs using rsvg-convert
- White icons ready for runtime color tinting with blendOp.DstIn
2026-05-09 23:44:05 -04:00
92d22cf0cd Add go generate setup for SVG icon embedding
- gen_icons.go: reads SVG files, generates icons.go with go:embed
- icons.go: generated file with embedded SVG strings
- Supports cut, copy, paste icons (search, conflict, wrapOn/Off to be added)
2026-05-09 23:08:10 -04:00
9b745bf66f Improve cut icon: two handles with crossing blades and pivot point 2026-05-09 22:54:17 -04:00
06daad99bb Add cut/copy/paste SVG icon assets 2026-05-09 22:53:19 -04:00
ae6cfcd448 Fix FrameEvent: hold mutex during draw + e.Frame() per architecture doc §8 2026-05-09 20:50:30 -04:00
620d534454 Break import cycle: use StateReader interface instead of direct State reference
- StateReader interface in ui package (Scale(), ScreenWidth(), ScreenHeight())
- State implements StateReader
- Renderer reads scale/window size via interface, never imports editor
- State fields are private (screenWidth, screenHeight, scale) with accessor methods
- No SetScale/SetWindowSize calls from main.go — Renderer reads from State directly
2026-05-09 20:33:00 -04:00
21b4df59a3 Fix event flow: ConfigEvent sets size, FrameEvent sets scale only
- ConfigEvent: ONLY from app.ConfigEvent, sets width/height in State
- FrameEvent: gets scale from gtx.Metric.PxPerDp, sends ScaleEvent only if changed
- ScaleEvent: updates State.Scale
- Renderer reads windowW/windowH from State (SetWindowSize), not gtx.Constraints
- Renderer reads scale from State (SetScale), not gtx.Metric.PxPerDp
- main.go: ConfigEvent calls SetWindowSize, FrameEvent calls SetScale
2026-05-09 20:26:10 -04:00
68437c32a7 Store scale in State, use it everywhere instead of gtx.Metric.PxPerDp
- State.Scale stores the scale factor (default 1.0)
- ScaleEvent applies SetScale() which updates State.Scale
- Logic.Scale() accessor returns current scale
- Renderer.SetScale() updates renderer's scale from State
- main.go: uses logic.Scale() to get scale, calls renderer.SetScale()
- No more references to gtx.Metric.PxPerDp in render.go or main.go
2026-05-09 20:23:02 -04:00
ef31701d87 Unify ConfigEvent and ScaleEvent on single channel with type switch
- ConfigUpdate interface with apply(*State) method
- ConfigEvent and ScaleEvent both implement ConfigUpdate
- Logic.ConfigChan() accepts both types
- Type switch in Run() differentiates ConfigEvent vs ScaleEvent
- main.go sends both on same ConfigChan()
2026-05-09 20:10:06 -04:00
fbf6cfac95 Fix ScaleEvent: track prevScale and only send when scale actually changes 2026-05-09 20:04:23 -04:00
b581abb691 Redesign ConfigEvent/Scale handling: ConfigEvent sets size, FrameEvent updates scale
- Logic layer has separate ConfigChan and ScaleChan
- ConfigEvent: width/height in Dp, set on ConfigEvent
- ScaleEvent: scale factor, set on FrameEvent when scale changes
- Logic has ScreenSize() accessor for layout/rendering pipeline
- Logic has SetScale() to update scale and recompute layout
- main.go: ConfigEvent stores pixels, converts to DP using current scale
- main.go: FrameEvent gets actual scale, sends ScaleEvent if changed
2026-05-09 19:59:27 -04:00
3fc28fd54b Document background drawing with clips — use push/pop, not op.Record macro 2026-05-09 19:17:56 -04:00
f433a992b7 Clean up debug output and fix clip push/pop pattern 2026-05-09 19:16:10 -04:00
4a9253616d Fix StatusBar background using push/pop instead of op.Record macro
The op.Record macro was leaving a clip on the stack that prevented
subsequent elements from drawing. Use clip.Rect{}.Push()/clip.Pop()
instead for immediate push/pop.
2026-05-09 19:13:33 -04:00
4893d69f4e Add light gray background to StatusBar and BottomBar
Rename shaper_usage.md to layout_rendering.md
2026-05-09 18:49:43 -04:00
b8c6878f46 Introduce distinct Dp/Px types to prevent coordinate mixing at compile time
- Add ui.Dp and ui.Px as distinct named types
- Logic layer works exclusively in Dp (positions, sizes, regions)
- Renderer converts Dp→Px at Gio interop boundaries
- Capture gtx.Constraints once at start of Draw() for consistent positioning
- main.go converts app.ConfigEvent pixels to Dp before passing to logic layer
- Update documentation with new coordinate system architecture
2026-05-09 18:40:47 -04:00
f563a515e6 Document BottomBar X positioning and widget constraint modification 2026-05-09 18:01:57 -04:00
4cf8641bbd Fix BottomBar X positioning to use visible window width 2026-05-09 18:01:24 -04:00
3a3a62a50c Document BottomBar visible window positioning and pixel/DP conversion 2026-05-09 17:22:31 -04:00
e096341533 Draw BottomBar at visible window bottom instead of region Y which may be outside viewport 2026-05-09 17:19:14 -04:00
9476f5448a Update BottomBar to use drawText instead of material.Label
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 15:53:14 -04:00
99b4db919b Always draw Cut, Copy, Paste, Search icons; only ConflictIcon is conditional
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 14:49:43 -04:00
9fd6239129 Clean up debug statements, restore proper icons, document multi-line text spacing
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 14:48:12 -04:00
f67cca1f4b Update shaper_usage.md with correct MinWidth/MaxWidth/MaxLines requirements and offset calculation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 14:07:47 -04:00
ca34a570a9 Fix text wrapping: add MinWidth/MaxWidth/MaxLines to all LayoutString calls
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 14:01:02 -04:00
ddd44baefd Fix offset to match Gio paintGlyph exactly: (x + first.X, y + first.Y) with no subtraction
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 13:15:29 -04:00
eb9754fde0 Fix text offset: use (x, y) for X and subtract baseline Y so text top aligns with y
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 13:11:03 -04:00
965d6074f3 Fix filename visibility by correcting coordinate offset in low-level drawing
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:52:22 -04:00
4798e8fe3d Fix offset calculation: derive from first glyph position like Gio's textView
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:32:28 -04:00
1ee75c1cd1 Add op.Record/Stop macro wrapping to drawLineText (matches Gio's textView)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:30:41 -04:00
1acad99450 Fix filename rendering: split drawText into layout + drawLineText to avoid triple LayoutString calls
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:26:35 -04:00
0f62ef32fa Update shaper_usage.md with correct glyph drawing approach
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:15:57 -04:00
fcd2fea870 Add drawTruncatedText for single-pass layout, measure, and render
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:14:46 -04:00
16719afb95 Use shaper.Shape() and shaper.Bitmaps() to draw glyphs directly (no double-shaping)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:13:06 -04:00
0fdaea990f Revert to material.Label for rendering - shp.Draw() not available in Gio v0.9.0
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-09 11:02:42 -04:00
87992c3d99 Fix charWidths to match Gio's textView PxPerEm calculation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-08 23:37:10 -04:00
96b7c6dc97 Remove debug logging
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-08 20:48:23 -04:00
9c1e32c52a Fix filename truncation with proper scaling and ellipsis width measurement
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-08 20:47:08 -04:00
bbd16be9f2 Improve filename truncation to fit exact number of characters
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-08 20:21:35 -04:00