Bug 312321

Summary: [Regression] Line number "broken" with the oxygen theme
Product: [Applications] kate Reporter: Emmanuel Lepage Vallée <emmanuel.lepage>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: ixloran, rdieter, yacwroy
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.2
Sentry Crash Report:
Attachments: Missing digit

Description Emmanuel Lepage Vallée 2012-12-28 21:47:44 UTC
A while ago, the 4px border that separated the line number column from the oxygen canvas border was removed. So now, if only line number and folding columns are visible, the first digit of the line number is under the inner border, making it invisible unless the user put the focus somewhere else. 

See screenshot

Reproducible: Always

Steps to Reproduce:
1. Use the oxygen theme
2. Open a file with 100+ line
3. Go to the last line
4. Notice the hidden digit
Actual Results:  
Hidden digit

Expected Results:  
Visible digit
Comment 1 Emmanuel Lepage Vallée 2012-12-28 21:48:18 UTC
Created attachment 76066 [details]
Missing digit
Comment 2 Dominik Haumann 2013-04-08 20:46:44 UTC
*** Bug 318062 has been marked as a duplicate of this bug. ***
Comment 3 Dominik Haumann 2013-09-18 14:26:41 UTC
Git commit 6e1f74970cd11705a134c2683b39d4c953a856f4 by Dominik Haumann.
Committed on 18/09/2013 at 14:26.
Pushed by dhaumann into branch 'master'.

fix margin when drawing the line numbers

This was never really an oxygen issue. Instead, for instance the font
"Courier", a digit has a real character width. Calculating with int
sums off and reflects in this bad offset.

FIXED-IN: 4.11.2

M  +10   -6    part/view/kateviewhelpers.cpp
M  +1    -1    part/view/kateviewhelpers.h

http://commits.kde.org/kate/6e1f74970cd11705a134c2683b39d4c953a856f4
Comment 4 Dominik Haumann 2013-09-18 14:27:19 UTC
Git commit 0e9732e2c6ab740b139ccc5a53e1b6b0e8a7982c by Dominik Haumann.
Committed on 18/09/2013 at 14:26.
Pushed by dhaumann into branch 'KDE/4.11'.

fix margin when drawing the line numbers

This was never really an oxygen issue. Instead, for instance the font
"Courier", a digit has a real character width. Calculating with int
sums off and reflects in this bad offset.

FIXED-IN: 4.11.2

M  +10   -6    part/view/kateviewhelpers.cpp
M  +1    -1    part/view/kateviewhelpers.h

http://commits.kde.org/kate/0e9732e2c6ab740b139ccc5a53e1b6b0e8a7982c
Comment 5 Dominik Haumann 2013-09-18 14:28:05 UTC
Git commit 2a386bce33fc35ad4e4be6efcf0101de5ef519fa by Dominik Haumann.
Committed on 18/09/2013 at 14:26.
Pushed by dhaumann into branch 'KDE/4.10'.

fix margin when drawing the line numbers

This was never really an oxygen issue. Instead, for instance the font
"Courier", a digit has a real character width. Calculating with int
sums off and reflects in this bad offset.

FIXED-IN: 4.11.2

M  +10   -6    part/view/kateviewhelpers.cpp
M  +1    -1    part/view/kateviewhelpers.h

http://commits.kde.org/kate/2a386bce33fc35ad4e4be6efcf0101de5ef519fa
Comment 6 Rex Dieter 2013-09-28 11:12:43 UTC
This commit introduced a build failure for arm (or any other arch where qreal != double), a minimal fix is:

diff -up kate-4.11.2/part/view/kateviewhelpers.cpp.arm_qreal kate-4.11.2/part/view/kateviewhelpers.cpp
--- kate-4.11.2/part/view/kateviewhelpers.cpp.arm_qreal 2013-09-26 14:18:55.616737800 -0500
+++ kate-4.11.2/part/view/kateviewhelpers.cpp   2013-09-28 05:35:00.496903155 -0500
@@ -1487,7 +1487,7 @@ void KateIconBorder::updateFont()
   // Loop to determine the widest numeric character in the current font.
   // 48 is ascii '0'
   for (int i = 48; i < 58; i++) {
-    const double charWidth = ceil(fm.width( QChar(i) ));
+    const qreal charWidth = ceil(fm.width( QChar(i) ));
     m_maxCharWidth = qMax(m_maxCharWidth, charWidth);
   }
Comment 7 Rex Dieter 2013-09-29 12:41:57 UTC
Git commit e9d199728ba473a28000b99d4994826caf761be2 by Rex Dieter.
Committed on 29/09/2013 at 12:41.
Pushed by rdieter into branch 'KDE/4.11'.

fix qreal!=double regression

M  +1    -1    part/view/kateviewhelpers.cpp

http://commits.kde.org/kate/e9d199728ba473a28000b99d4994826caf761be2
Comment 8 Dominik Haumann 2013-09-30 12:02:01 UTC
Git commit 3a0a241bc232086fa3cbe251fd1f9d1bbecbc684 by Dominik Haumann, on behalf of Rex Dieter.
Committed on 29/09/2013 at 12:41.
Pushed by dhaumann into branch 'master'.

fix qreal!=double regression

M  +1    -1    part/view/kateviewhelpers.cpp

http://commits.kde.org/kate/3a0a241bc232086fa3cbe251fd1f9d1bbecbc684
Comment 9 Dominik Haumann 2013-09-30 12:02:45 UTC
Git commit 30b184203e5eda221166dbf4adb8f36284d6592c by Dominik Haumann, on behalf of Rex Dieter.
Committed on 29/09/2013 at 12:41.
Pushed by dhaumann into branch 'KDE/4.10'.

fix qreal!=double regression

M  +1    -1    part/view/kateviewhelpers.cpp

http://commits.kde.org/kate/30b184203e5eda221166dbf4adb8f36284d6592c