Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Spectacle
Commits
b2bd3c3d
Verified
Commit
b2bd3c3d
authored
Dec 09, 2021
by
Antonio Prcela
🏞
Browse files
Cancel drag and drop if there is no screenshot in the preview.
parent
25e28f6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Gui/KSWidget.cpp
View file @
b2bd3c3d
...
...
@@ -174,6 +174,7 @@ KSWidget::KSWidget(Platform::GrabModes theGrabModes, QWidget *parent)
mPlaceholderLabel
->
setTextInteractionFlags
(
Qt
::
NoTextInteraction
);
mPlaceholderLabel
->
setWordWrap
(
true
);
mPlaceholderLabel
->
setAlignment
(
Qt
::
AlignCenter
);
mPlaceholderLabel
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
// Match opacity of QML placeholder label component
auto
*
effect
=
new
QGraphicsOpacityEffect
(
mPlaceholderLabel
);
effect
->
setOpacity
(
0.5
);
...
...
@@ -227,6 +228,7 @@ bool KSWidget::isScreenshotSet()
void
KSWidget
::
showPlaceholderText
(
const
QString
&
label
)
{
mImageWidget
->
hide
();
mPlaceholderLabel
->
setText
(
label
);
mPlaceholderLabel
->
show
();
}
...
...
@@ -236,6 +238,7 @@ void KSWidget::setScreenshotPixmap(const QPixmap &thePixmap)
if
(
mPlaceholderLabel
->
isVisible
())
{
mPlaceholderLabel
->
hide
();
}
mImageWidget
->
show
();
mImageWidget
->
setScreenshot
(
thePixmap
);
}
...
...
src/SpectacleCore.cpp
View file @
b2bd3c3d
...
...
@@ -518,6 +518,9 @@ void SpectacleCore::populateCommandLineParser(QCommandLineParser *lCmdLineParser
void
SpectacleCore
::
doStartDragAndDrop
()
{
auto
lExportManager
=
ExportManager
::
instance
();
if
(
lExportManager
->
pixmap
().
isNull
())
{
return
;
}
QUrl
lTempFile
=
lExportManager
->
tempSave
();
if
(
!
lTempFile
.
isValid
())
{
return
;
...
...
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