Open mikigal opened 6 months ago
@mikigal did you try it on 150% yet? The behaviour is not the same. I also read, that on 125% windows API may return a faulty scale, so maybe that is influencing it in the background. See: https://stackoverflow.com/questions/70340316/how-to-get-monitor-resolution-independent-of-scaling (that somment: https://stackoverflow.com/questions/70340316/how-to-get-monitor-resolution-independent-of-scaling#comment124345342_70340316 )
@0xkalle Maybe this can help? https://stackoverflow.com/questions/70794284/how-to-get-current-monitor-scale
What happend?
When I set display scale in Windows above 100% my app does not scale corretly - window is bigger, but it's content (widgets, fonts, SplitLayouts) does not scale with window size.
Code example
Ful code of GUI: https://github.com/mikigal/Anime4K-GUI/blob/master/gui.go
```golang g.SingleWindow().Layout( g.SplitLayout(g.DirectionVertical, 580, g.SplitLayout(g.DirectionHorizontal, 1200, g.Layout{ g.Table().Flags(g.TableFlagsResizable).Rows(buildTableRows()...).Columns(buildTableColumns()...), g.Custom(func() { if len(animeList) == 0 { g.Label("\n\n\n\n\n\n\n Drag n' Drop your anime here").Font(g.AddFont("Arial", 35)).Build() } }), }, g.Layout{ g.Label("Settings"), g.Label(""), g.Label("Target resolution"), g.Combo("", resolutionsNames[settings.Resolution], resolutionsNames, &settings.Resolution).Size(400), g.Label(""), g.Label("Shaders mode"), g.Tooltip("Check the project's GitHub page if you're not sure what to choose"), g.Combo("", shaders[settings.Shaders].Name, shadersNames, &settings.Shaders).Size(400), g.Tooltip("Check the project's GitHub page if you're not sure what to choose"), g.Label(""), g.Label("Encoder"), g.Tooltip("Codec for encoding output file. In most cases GPU based are faster, use CPU mainly if you have slow GPU\n" + "AV1 is compatible only with RTX 4000+ and RX 6500XT+"), g.Combo("", availableEncoders[settings.Encoder].Name, availableEncodersNames, &settings.Encoder).Size(400), g.Tooltip("Codec for encoding output file. In most cases GPU based are faster, use CPU mainly if you have slow GPU\n" + "GPU based AV1 is compatible only with RTX 4000+ and RX 6500XT+"), g.Label(""), g.Label("Output format"), g.Combo("", outputFormats[settings.OutputFormat], outputFormats, &settings.OutputFormat).Size(400), g.Label(""), g.Checkbox("Compatibility mode", &settings.CompatibilityMode), g.Tooltip("Should be used only for compatibility troubleshooting, disables most of features"), g.Checkbox("Debug mode", &settings.DebugMode), g.Tooltip("Show more detailed logs, useful for troubleshooting and debugging"), g.Label(""), g.Button(buttonLabel).OnClick(handleButton).Size(360, 30), }, ), g.Layout{ g.Label("Logs"), g.InputTextMultiline(&logs).Flags(g.InputTextFlagsReadOnly).Size(1600, 270), g.SplitLayout(g.DirectionHorizontal, 1310, g.SplitLayout(g.DirectionHorizontal, 120, g.Label("Progress: "+totalProgress), g.ProgressBar(progress).Overlay(progressLabel).Size(1170, 20), ), g.SplitLayout(g.DirectionHorizontal, 110, g.Label(currentSpeed), g.Label(eta), ), ), }, ), ) ```main.go
To Reproduce
Version
master
OS
Windows 11 23H2