Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Krita
Commits
900f802f
Commit
900f802f
authored
Apr 09, 2019
by
Ivan Yossi
👌
Browse files
Fix: Unable to select NewView item with long paths in OSX
BUG:403639
parent
c43c8066
Changes
1
Hide whitespace changes
Inline
Side-by-side
libs/ui/KisMainWindow.cpp
View file @
900f802f
...
...
@@ -2129,9 +2129,12 @@ void KisMainWindow::updateWindowMenu()
QMenu
*
docMenu
=
d
->
documentMenu
->
menu
();
docMenu
->
clear
();
QFontMetrics
fontMetrics
=
docMenu
->
fontMetrics
();
int
fileStringWidth
=
int
(
QApplication
::
desktop
()
->
screenGeometry
(
this
).
width
()
*
.40
f
);
Q_FOREACH
(
QPointer
<
KisDocument
>
doc
,
KisPart
::
instance
()
->
documents
())
{
if
(
doc
)
{
QString
title
=
doc
->
url
().
toDisplayString
();
QString
title
=
fontMetrics
.
elidedText
(
doc
->
url
().
toDisplayString
(
QUrl
::
PreferLocalFile
),
Qt
::
ElideMiddle
,
fileStringWidth
);
if
(
title
.
isEmpty
()
&&
doc
->
image
())
{
title
=
doc
->
image
()
->
objectName
();
}
...
...
@@ -2229,10 +2232,10 @@ void KisMainWindow::updateWindowMenu()
if
(
child
&&
child
->
document
())
{
QString
text
;
if
(
i
<
9
)
{
text
=
i18n
(
"&%1 %2"
,
i
+
1
,
child
->
document
()
->
url
().
toDisplayString
());
text
=
i18n
(
"&%1 %2"
,
i
+
1
,
fontMetrics
.
elidedText
(
child
->
document
()
->
url
().
toDisplayString
(
QUrl
::
PreferLocalFile
),
Qt
::
ElideMiddle
,
fileStringWidth
));
}
else
{
text
=
i18n
(
"%1 %2"
,
i
+
1
,
child
->
document
()
->
url
().
toDisplayString
());
text
=
i18n
(
"%1 %2"
,
i
+
1
,
fontMetrics
.
elidedText
(
child
->
document
()
->
url
().
toDisplayString
(
QUrl
::
PreferLocalFile
),
Qt
::
ElideMiddle
,
fileStringWidth
));
}
QAction
*
action
=
menu
->
addAction
(
text
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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