Add focused window controls to top bar
Introduces a new `WindowControls` component in the desktop top bar with minimize, maximize/restore, and close actions for the focused window. `WindowService` now exposes focused-window presence/maximized state plus focused-window convenience actions to support this UI. Also extends Nebula UI with a reusable `NebulaToolTip`, keyboard/pressed-state support in `NebulaIconButton`, new window-control glyphs in `NebulaIcon`, and theme tokens for pressed/danger hover states, with CMake and README updates to register/document the new components.
This commit is contained in:
@@ -82,6 +82,18 @@ Item {
|
||||
case "application":
|
||||
paintApplication(ctx)
|
||||
break
|
||||
case "minimize":
|
||||
paintMinimize(ctx)
|
||||
break
|
||||
case "maximize":
|
||||
paintMaximize(ctx)
|
||||
break
|
||||
case "restore":
|
||||
paintRestore(ctx)
|
||||
break
|
||||
case "close":
|
||||
paintClose(ctx)
|
||||
break
|
||||
default:
|
||||
paintApplication(ctx)
|
||||
break
|
||||
@@ -192,6 +204,41 @@ Item {
|
||||
ctx.stroke()
|
||||
}
|
||||
|
||||
function paintMinimize(ctx) {
|
||||
ctx.lineWidth = 1.7
|
||||
ctx.beginPath()
|
||||
ctx.moveTo(6.4, 16.2)
|
||||
ctx.lineTo(17.6, 16.2)
|
||||
ctx.stroke()
|
||||
}
|
||||
|
||||
function paintMaximize(ctx) {
|
||||
ctx.lineWidth = 1.5
|
||||
ctx.beginPath()
|
||||
roundedRect(ctx, 6.2, 6.2, 11.6, 11.6, 2)
|
||||
ctx.stroke()
|
||||
}
|
||||
|
||||
function paintRestore(ctx) {
|
||||
ctx.lineWidth = 1.45
|
||||
ctx.beginPath()
|
||||
roundedRect(ctx, 8.6, 5.6, 9.4, 9.4, 1.7)
|
||||
ctx.stroke()
|
||||
ctx.beginPath()
|
||||
roundedRect(ctx, 5.6, 8.6, 9.4, 9.4, 1.7)
|
||||
ctx.stroke()
|
||||
}
|
||||
|
||||
function paintClose(ctx) {
|
||||
ctx.lineWidth = 1.7
|
||||
ctx.beginPath()
|
||||
ctx.moveTo(7.3, 7.3)
|
||||
ctx.lineTo(16.7, 16.7)
|
||||
ctx.moveTo(16.7, 7.3)
|
||||
ctx.lineTo(7.3, 16.7)
|
||||
ctx.stroke()
|
||||
}
|
||||
|
||||
function paintApplication(ctx) {
|
||||
ctx.lineWidth = 1.5
|
||||
ctx.beginPath()
|
||||
|
||||
Reference in New Issue
Block a user