Make the resize keys do what the fingers expect
Audited against the real Forge configuration rather than its defaults: the bindings are still in dconf, and the extension is still installed, so both the keys and the code behind them could be read directly. The port was faithful. Forge's resize() grows the window for a positive amount in every direction -- the edge only decides which side moves -- so "increase" meant grow and "decrease" meant shrink, and Y/O/I/U mapped to Wider and Taller exactly as they should have. What did not survive is direction. Forge resized one named EDGE: Y pulled the left edge leftward, O pushed the right edge rightward, and the window opened from the side you asked for. Hyprland resizes along an axis and lets the layout pick the border, so eight distinct behaviours collapse onto four and the direction is not expressible at all in dwindle. Correct on paper, wrong under the hands: the keys that used to pull a window open from one side now push it from the other, which reads as the pair being swapped. So the sizes are inverted from Forge's naming on purpose. Y and O shrink, B and M grow, I and U shorten, N and Comma lengthen. Faithfulness to a mapping nobody can feel is worth less than keys that behave the way their owner reaches for them, and the reason is written where the next person will find it. Also fixes the Home Assistant accessories dropdown, which looked glitchy for a reason that was not performance. The resting card hid the instant the section opened -- a Column skips invisible children, so everything above snapped up while the expanded grid was still sliding open underneath. It now collapses on the same curve and duration as the section replacing it. This was the only control with a resting and an expanded form that swap, which is why it was the only one that looked wrong. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -180,23 +180,30 @@ bind(mod .. " + CTRL + L", hl.dsp.window.swap({ direction = "r" }), { descriptio
|
||||
|
||||
-- Resize (Forge: window-resize-<edge>-<increase|decrease>).
|
||||
--
|
||||
-- Forge resized one named edge at a time. Hyprland resizes the active window
|
||||
-- along an axis and lets the layout decide which edge actually moves, so the
|
||||
-- eight Forge keys collapse onto four behaviors. The pairing is kept
|
||||
-- consistent with the original: Y/B/O/M are horizontal, I/P/U/N are vertical,
|
||||
-- and "increase" always grows while "decrease" always shrinks.
|
||||
-- Forge resized one named EDGE at a time: its resize() grows the window for a
|
||||
-- positive amount in every direction, and the edge only decides which side
|
||||
-- moves -- Y grew leftward, O grew rightward, and so on. Hyprland resizes along
|
||||
-- an axis and lets the layout choose the border, so those eight distinct
|
||||
-- behaviours collapse onto four and the direction is simply not expressible.
|
||||
--
|
||||
-- Because of that the sizes are deliberately INVERTED from Forge's naming.
|
||||
-- Carried over faithfully, "increase" grew and "decrease" shrank, which was
|
||||
-- correct on paper and wrong under the fingers: with the edge gone, the keys
|
||||
-- that used to pull a window open from one side now push it from the other.
|
||||
-- Gabriel uses these daily and reads Y/O as shrink and B/M as grow, so that is
|
||||
-- what they do. Faithfulness to a mapping nobody can feel is not worth much.
|
||||
local step = 60
|
||||
bind(mod .. " + SHIFT + Y", hl.dsp.window.resize({ x = step, y = 0, relative = true }), { repeating = true, description = "Wider" })
|
||||
bind(mod .. " + SHIFT + O", hl.dsp.window.resize({ x = step, y = 0, relative = true }), { repeating = true, description = "Wider" })
|
||||
bind(mod .. " + SHIFT + B", hl.dsp.window.resize({ x = -step, y = 0, relative = true }), { repeating = true, description = "Narrower" })
|
||||
bind(mod .. " + SHIFT + M", hl.dsp.window.resize({ x = -step, y = 0, relative = true }), { repeating = true, description = "Narrower" })
|
||||
bind(mod .. " + SHIFT + I", hl.dsp.window.resize({ x = 0, y = step, relative = true }), { repeating = true, description = "Taller" })
|
||||
bind(mod .. " + SHIFT + U", hl.dsp.window.resize({ x = 0, y = step, relative = true }), { repeating = true, description = "Taller" })
|
||||
bind(mod .. " + SHIFT + Y", hl.dsp.window.resize({ x = -step, y = 0, relative = true }), { repeating = true, description = "Narrower" })
|
||||
bind(mod .. " + SHIFT + O", hl.dsp.window.resize({ x = -step, y = 0, relative = true }), { repeating = true, description = "Narrower" })
|
||||
bind(mod .. " + SHIFT + B", hl.dsp.window.resize({ x = step, y = 0, relative = true }), { repeating = true, description = "Wider" })
|
||||
bind(mod .. " + SHIFT + M", hl.dsp.window.resize({ x = step, y = 0, relative = true }), { repeating = true, description = "Wider" })
|
||||
bind(mod .. " + SHIFT + I", hl.dsp.window.resize({ x = 0, y = -step, relative = true }), { repeating = true, description = "Shorter" })
|
||||
bind(mod .. " + SHIFT + U", hl.dsp.window.resize({ x = 0, y = -step, relative = true }), { repeating = true, description = "Shorter" })
|
||||
-- SUPER+SHIFT+P was double-bound with the color picker above; moved to
|
||||
-- Comma, which continues the bottom-row cluster (B/M/N) this axis already
|
||||
-- uses rather than landing on an arbitrary free key.
|
||||
bind(mod .. " + SHIFT + Comma", hl.dsp.window.resize({ x = 0, y = -step, relative = true }), { repeating = true, description = "Shorter" })
|
||||
bind(mod .. " + SHIFT + N", hl.dsp.window.resize({ x = 0, y = -step, relative = true }), { repeating = true, description = "Shorter" })
|
||||
bind(mod .. " + SHIFT + Comma", hl.dsp.window.resize({ x = 0, y = step, relative = true }), { repeating = true, description = "Taller" })
|
||||
bind(mod .. " + SHIFT + N", hl.dsp.window.resize({ x = 0, y = step, relative = true }), { repeating = true, description = "Taller" })
|
||||
|
||||
-- Window cycling (GNOME: cycle-windows on SUPER+Tab), now with an overlay
|
||||
-- showing what you are choosing between.
|
||||
|
||||
@@ -36,9 +36,30 @@ Item {
|
||||
|
||||
Rectangle {
|
||||
id: restingCard
|
||||
|
||||
// Shown when the section is closed; the expanded grid below replaces
|
||||
// it when open.
|
||||
readonly property bool shown: root.hasSelection && !root.expanded
|
||||
|
||||
width: parent.width
|
||||
height: visible ? restingGrid.implicitHeight + 20 : 0
|
||||
visible: root.hasSelection && !root.expanded
|
||||
|
||||
// Animated, and on the same curve and duration as the Section that
|
||||
// replaces it. Previously this hid the instant `expanded` flipped:
|
||||
// a Column skips invisible children, so everything above snapped up
|
||||
// while the expanded grid was still sliding open underneath. That
|
||||
// read as a glitch rather than as an animation, and only here,
|
||||
// because this is the only control with a resting and an expanded
|
||||
// form that swap.
|
||||
height: restingCard.shown ? restingGrid.implicitHeight + 20 : 0
|
||||
visible: height > 0
|
||||
clip: true
|
||||
|
||||
Behavior on height {
|
||||
NumberAnimation {
|
||||
duration: Theme.durNormal
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
radius: Theme.cardRadius + 2
|
||||
color: Theme.alpha(Theme.warn, 0.028)
|
||||
border.width: 1
|
||||
|
||||
Reference in New Issue
Block a user