Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
System
Kup
Commits
8286f5e4
Commit
8286f5e4
authored
May 09, 2014
by
Simon Persson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make drive selection expand vertically and no text overlap in delegate
Both are just small cosmetic changes.
parent
69f2447e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
kcm/backupplanwidget.cpp
kcm/backupplanwidget.cpp
+1
-1
kcm/driveselectiondelegate.cpp
kcm/driveselectiondelegate.cpp
+5
-1
No files found.
kcm/backupplanwidget.cpp
View file @
8286f5e4
...
...
@@ -382,7 +382,7 @@ KPageWidgetItem *BackupPlanWidget::createDestinationPage() {
lVLayout
->
addWidget
(
lFileSystemRadio
);
lVLayout
->
addWidget
(
lFileSystemWidget
);
lVLayout
->
addWidget
(
lDriveRadio
);
lVLayout
->
addWidget
(
lDriveWidget
);
lVLayout
->
addWidget
(
lDriveWidget
,
1
);
lVLayout
->
addStretch
();
lButtonGroup
->
setLayout
(
lVLayout
);
...
...
kcm/driveselectiondelegate.cpp
View file @
8286f5e4
...
...
@@ -70,13 +70,16 @@ void DriveSelectionDelegate::paint(QPainter* pPainter, const QStyleOptionViewIte
KLocale
*
lLocale
=
KGlobal
::
locale
();
QString
lDisplayLabel
,
lPartitionLabel
,
lDisconnectedLabel
;
int
lTextEnd
=
pOption
.
rect
.
right
()
-
cMargin
;
if
(
lIsDisconnected
)
{
lDisconnectedLabel
=
i18nc
(
"@item:inlistbox this text is added if selected drive is disconnected"
,
" (disconnected)"
);
}
else
{
lDisconnectedLabel
=
QString
();
QString
lFreeSpace
=
i18nc
(
"@label %1 is amount of free storage space of hard drive"
,
"%1 free"
,
lLocale
->
formatByteSize
(
lTotalSize
-
lUsedSize
,
1
));
pPainter
->
drawText
(
pOption
.
rect
.
topRight
()
+
QPoint
(
-
(
cMargin
+
QApplication
::
fontMetrics
().
width
(
lFreeSpace
)),
int
lTextWidth
=
QApplication
::
fontMetrics
().
width
(
lFreeSpace
);
lTextEnd
-=
lTextWidth
+
cMargin
;
pPainter
->
drawText
(
pOption
.
rect
.
topRight
()
+
QPoint
(
-
cMargin
-
lTextWidth
,
cMargin
+
QApplication
::
fontMetrics
().
height
()),
lFreeSpace
);
}
...
...
@@ -102,6 +105,7 @@ void DriveSelectionDelegate::paint(QPainter* pPainter, const QStyleOptionViewIte
lDisplayLabel
=
i18nc
(
"@item:inlistbox %1 is drive(partition) label, %2 is storage capacity"
,
"%1: %2 total capacity"
,
lPartitionLabel
,
lLocale
->
formatByteSize
(
lTotalSize
,
1
));
}
lDisplayLabel
=
QApplication
::
fontMetrics
().
elidedText
(
lDisplayLabel
,
Qt
::
ElideMiddle
,
lTextEnd
-
pOption
.
rect
.
left
()
-
cMargin
);
pPainter
->
drawText
(
pOption
.
rect
.
topLeft
()
+
QPoint
(
cMargin
,
cMargin
+
QApplication
::
fontMetrics
().
height
()),
lDisplayLabel
);
int
lIconSize
=
KIconLoader
::
SizeLarge
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment