MrKai77/Loop

๐Ÿž Change Custom Width/Height Percentages from Int to Float

Closed this issue ยท 12 comments

Bug Description

I'm using the "Custom" feature to tile my windows into sixths:

remove-gap-in-window-layout

I'm getting annoying gaps between the windows since floats aren't accepted in the custom width/height fields:
window-resize-options

I'd like to create a custom width/height percentage that can be a float instead of just an int to avoid these sorts of gaps. The current behavior is that typing a float (e.g. "33.333333") in this box forces the width percentage to an int.

Happy to solve this problem another way if you know of one!

Steps To Reproduce

  1. Open Loop > Keybindings > Add "Custom" > Click Size
  2. Under "Width", type "33.33333" and it'll be forced down to 33% which is (I'm guessing) the cause of those gaps

Expected Behavior

Floats like 33.3333% are allowed to allow extra precision and avoid gaps.

Actual Behavior

Only integer values for width/height percentages are allowed

Screenshots

No response

MacOS Version

14

Loop Version

1.0.0 (1030)

Additional Context

No response

Final Checks

  • My issue title is descriptive
  • This is a single bug (multiple bugs should be reported individually)

Hmm.. the value is stored as a float, and is only rounded in the UI. Can you reproduce this with other apps?

I'm using the "Custom" feature to tile my windows into sixths:

I actually have this and it seems fine (?)

000680@2x

000681@2x

Do you have gaps enabled?

@bijanoviedo It may be because you are using a terminal app that is restricted to being resized in increments of your font size. I know you can disable this setting in iTerm2 etc, but I'm not sure if you can disable that in the system's Terminal.app.

I have the same setup and would also like to be able to specify a 1/3rd width instead of the rounded 33% which creates gaps between windows.

@mugoosse as stated in my previous comment, values are not rounded to the nearest integer. They are kept as decimals within the app, but shown rounded in the UI. You can verify this by exporting your keybinds as JSON in the "Advanced" tab, then checking the decimal values yourself.

@mugoosse as stated in my previous comment, values are not rounded to the nearest integer. They are kept as decimals within the app, but shown rounded in the UI. You can verify this by exporting your keybinds as JSON in the "Advanced" tab, then checking the decimal values yourself.

I exported the key bindings and it saved a width of 33, not 33.33333 as I entered. I also tried entering 33,33333 with no different outcome.

This is the the key binding object:

{
    "anchor" : 2,
    "direction" : "Custom",
    "height" : 50,
    "keybind" : [
      124,
      126
    ],
    "name" : "Top right",
    "positionMode" : 0,
    "sizeMode" : 0,
    "unit" : 1,
    "width" : 33,
    "xPoint" : 10,
    "yPoint" : 10
  }

The keybindings are supposed to split my windows up in six equally sized frames of 1/3rd of the screen width and 1/2th of the screen height.

Maybe you can try achieving this on your end to see the behaviour as well? The outcome is that there's a 0.5% gap between the windows:

image

FYI, in the meantime I achieved what wanted by manually updating the width values to 33.33333 in the exported keybinds.json file and importing it as new config file.

Hmm alright
I will look into this!

Fixed! Will be on the latest prerelease within 24 hours :)

What was the issue ๐Ÿ˜ญ

Looks like some sliders had decimal places disabled :p

Lolllll, weird