View Issue Details

IDProjectCategoryView StatusLast Update
0034702LazarusWidgetsetpublic2020-01-30 15:20
ReporterCudaText manAssigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionreopened 
PlatformmacOS 10.8OSOS Version
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0034702: Cocoa: in Retina video mode (hi dpi), buttons look broken
DescriptionCudaText "save tabs on close?" dialog has buttons aligned on the bottom. they are aligned (by anchors), it is not ButtonPanel.
OS has set HI-DPI video mode to test app. and buttons look broken, picture.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCocoa
Attached Files

Relationships

related to 0035029 new ListView support for multi-resolution image lists 
related to 0027934 assignedFelipe Monteiro de Carvalho Height of TEdit appears to small 

Activities

CudaText man

2018-12-14 16:02

reporter  

macos-retina-buttons.png (199,165 bytes)
macos-retina-buttons.png (199,165 bytes)

CudaText man

2018-12-14 16:20

reporter   ~0112565

Here is the form LFM
https://github.com/Alexey-T/CudaText/blob/master/app/formsavetabs.lfm

CudaText man

2019-04-18 09:34

reporter   ~0115630

some progress with the issue?

Dmitry Boyarintsev

2020-01-17 14:33

developer   ~0120495

the issue doesn't manifest itself

https://wiki.freepascal.org/Cocoa_DPI

buttons.zip (109,005 bytes)

CudaText man

2020-01-17 14:54

reporter   ~0120496

WIth last trunk, issue is still here on macOS 10.8.

Dmitry Boyarintsev

2020-01-17 15:01

developer   ~0120497

Last edited: 2020-01-17 15:43

View 2 revisions

could you please provide a screenshot of the project in button.zip?!

CudaText man

2020-01-19 11:50

reporter   ~0120541

Note: I Changed WS of proj to Cocoa.
And see the same bad look.

maOS 10.8 bad.png (144,714 bytes)
maOS 10.8 bad.png (144,714 bytes)

Dmitry Boyarintsev

2020-01-19 16:36

developer   ~0120547

indeed, autosizing fails

Dmitry Boyarintsev

2020-01-26 05:55

developer   ~0120751

please provide the (textural) output of the project at testsizing.zip

testsizing.zip (3,329 bytes)

CudaText man

2020-01-26 08:38

reporter   ~0120753

added screenshot.

hi-dpi-test.png (203,072 bytes)
hi-dpi-test.png (203,072 bytes)

Chris Rorden

2020-01-26 16:17

reporter   ~0120761

My values look very different from CudaTextMan. I am using svn 62589 on MacOS 10.14.6. I wonder if reinstalling from trunk or removing the compiled files in Lazararus/LCL/Units might resolve this. On the other hand, this might be an issue with support for MacOS 10.8.

10_14_6_svn62589.png (61,535 bytes)
10_14_6_svn62589.png (61,535 bytes)

CudaText man

2020-01-26 16:32

reporter   ~0120763

- update svn to last version don't help, deleting folder lazarus/lcl/units - too.
- if I change OS video mode during demo started, than button scale nicely - like on Chris's image

Dmitry Boyarintsev

2020-01-28 05:10

developer   ~0120781

please run testsizing2
the most interesting part is the information below "--- not" line.

testsizing2.zip (3,506 bytes)

CudaText man

2020-01-28 09:32

reporter   ~0120784

screenshot of testsizing2.

test2-macos-10.8.png (259,919 bytes)
test2-macos-10.8.png (259,919 bytes)

Dmitry Boyarintsev

2020-01-28 21:06

developer   ~0120788

is 0027934 also still an issue for 10.8?

CudaText man

2020-01-29 10:34

reporter   ~0120791

Replied there- 0027934

Dmitry Boyarintsev

2020-01-30 04:13

developer   ~0120800

please try the attached patch

controls_autosizing.diff (1,166 bytes)
Index: lcl/interfaces/cocoa/cocoawscommon.pas
===================================================================
--- lcl/interfaces/cocoa/cocoawscommon.pas	(revision 62594)
+++ lcl/interfaces/cocoa/cocoawscommon.pas	(working copy)
@@ -1651,6 +1651,7 @@
   lView: NSView;
   Size: NSSize;
   r: TRect;
+  fr: NSRect;
 begin
   if not AWinControl.HandleAllocated then Exit;
 
@@ -1662,6 +1663,16 @@
   //produces wrong size: width 3 and height 26 (or OSX 10.9)
   //as well as SpinEdit itself. The better approach is to use intrinsicContentSize method.
   // Felipe: intrinsicContentSize doesn't give any better results in my tests, it results in even smaller controls
+  if (lView.isKindOfClass(NSControl)) then
+  begin
+    fr := NSControl(lView).frame;
+    NSControl(lView).sizeToFit;
+    Size := NSControl(lView).frame.size;
+    lView.setFrame(fr);
+    r := lview.lclGetFrameToLayoutDelta;
+    PreferredWidth := Round(Size.width) - r.Left + r.Right;
+    PreferredHeight := Round(Size.height) - r.Top + r.Bottom;
+  end else
   if lView.respondsToSelector(objcselector('fittingSize')) then // fittingSize is 10.7+
   begin
     Size := lView.fittingSize();
controls_autosizing.diff (1,166 bytes)

CudaText man

2020-01-30 15:20

reporter   ~0120808

fix is not Ok,
- demo was fixed
- IDE was broken
3 screenshots.

fixed-10.8.png (279,427 bytes)
still-bad2.png (144,974 bytes)
still-bad2.png (144,974 bytes)
still-bug.png (213,876 bytes)
still-bug.png (213,876 bytes)

Issue History

Date Modified Username Field Change
2018-12-14 16:02 CudaText man New Issue
2018-12-14 16:02 CudaText man File Added: macos-retina-buttons.png
2018-12-14 16:20 CudaText man Note Added: 0112565
2019-04-18 06:02 Dmitry Boyarintsev Relationship added related to 0027934
2019-04-18 06:03 Dmitry Boyarintsev Relationship added related to 0035029
2019-04-18 09:34 CudaText man Note Added: 0115630
2020-01-17 14:33 Dmitry Boyarintsev File Added: buttons.zip
2020-01-17 14:33 Dmitry Boyarintsev File Added: Screen Shot 2020-01-17 at 8.31.48 AM.png
2020-01-17 14:33 Dmitry Boyarintsev File Added: Screen Shot 2020-01-17 at 8.31.06 AM.png
2020-01-17 14:33 Dmitry Boyarintsev Note Added: 0120495
2020-01-17 14:34 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2020-01-17 14:34 Dmitry Boyarintsev Status new => resolved
2020-01-17 14:34 Dmitry Boyarintsev Resolution open => no change required
2020-01-17 14:34 Dmitry Boyarintsev LazTarget => -
2020-01-17 14:34 Dmitry Boyarintsev Widgetset Cocoa => Cocoa
2020-01-17 14:54 CudaText man Note Added: 0120496
2020-01-17 15:01 Dmitry Boyarintsev Note Added: 0120497
2020-01-17 15:43 Dmitry Boyarintsev Note Edited: 0120497 View Revisions
2020-01-17 20:24 Dmitry Boyarintsev Status resolved => feedback
2020-01-17 20:24 Dmitry Boyarintsev Resolution no change required => reopened
2020-01-19 11:50 CudaText man File Added: maOS 10.8 bad.png
2020-01-19 11:50 CudaText man Note Added: 0120541
2020-01-19 11:50 CudaText man Status feedback => assigned
2020-01-19 16:36 Dmitry Boyarintsev Note Added: 0120547
2020-01-26 05:55 Dmitry Boyarintsev File Added: testsizing.zip
2020-01-26 05:55 Dmitry Boyarintsev Note Added: 0120751
2020-01-26 05:55 Dmitry Boyarintsev Status assigned => feedback
2020-01-26 08:38 CudaText man File Added: hi-dpi-test.png
2020-01-26 08:38 CudaText man Note Added: 0120753
2020-01-26 08:38 CudaText man Status feedback => assigned
2020-01-26 16:17 Chris Rorden File Added: 10_14_6_svn62589.png
2020-01-26 16:17 Chris Rorden Note Added: 0120761
2020-01-26 16:32 CudaText man Note Added: 0120763
2020-01-28 05:10 Dmitry Boyarintsev File Added: testsizing2.zip
2020-01-28 05:10 Dmitry Boyarintsev Note Added: 0120781
2020-01-28 05:10 Dmitry Boyarintsev Status assigned => feedback
2020-01-28 09:32 CudaText man File Added: test2-macos-10.8.png
2020-01-28 09:32 CudaText man Note Added: 0120784
2020-01-28 09:32 CudaText man Status feedback => assigned
2020-01-28 21:06 Dmitry Boyarintsev Status assigned => feedback
2020-01-28 21:06 Dmitry Boyarintsev Note Added: 0120788
2020-01-29 10:34 CudaText man Note Added: 0120791
2020-01-29 10:34 CudaText man Status feedback => assigned
2020-01-30 04:13 Dmitry Boyarintsev File Added: controls_autosizing.diff
2020-01-30 04:13 Dmitry Boyarintsev Note Added: 0120800
2020-01-30 04:13 Dmitry Boyarintsev Status assigned => feedback
2020-01-30 15:20 CudaText man File Added: fixed-10.8.png
2020-01-30 15:20 CudaText man File Added: still-bad2.png
2020-01-30 15:20 CudaText man File Added: still-bug.png
2020-01-30 15:20 CudaText man Note Added: 0120808
2020-01-30 15:20 CudaText man Status feedback => assigned