Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eoin O'Neill
Krita
Commits
eff5fa3f
Commit
eff5fa3f
authored
Apr 03, 2014
by
Halla Rempt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended splash screen: morph into a dialog when the app is done starting
Conflicts: libs/main/KoApplication.cpp
parent
f97c4e14
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
169 additions
and
54 deletions
+169
-54
krita/kis_splash_screen.cpp
krita/kis_splash_screen.cpp
+67
-2
krita/kis_splash_screen.h
krita/kis_splash_screen.h
+12
-3
krita/main.cc
krita/main.cc
+1
-1
krita/wdgsplash.ui
krita/wdgsplash.ui
+49
-44
libs/main/KoApplication.cpp
libs/main/KoApplication.cpp
+35
-4
libs/main/KoApplication.h
libs/main/KoApplication.h
+5
-0
No files found.
krita/kis_splash_screen.cpp
View file @
eff5fa3f
...
...
@@ -17,8 +17,73 @@
*/
#include "kis_splash_screen.h"
KisSplashScreen
::
KisSplashScreen
(
QWidget
*
parent
)
:
QWidget
(
parent
)
#include <QApplication>
#include <QDesktopWidget>
#include <QPixmap>
#include <QCheckBox>
#include <QDebug>
#include <klocale.h>
#include <kconfig.h>
#include <kglobal.h>
#include <kconfiggroup.h>
KisSplashScreen
::
KisSplashScreen
(
const
QString
&
version
,
const
QPixmap
&
pixmap
,
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
QWidget
(
parent
,
Qt
::
SplashScreen
|
Qt
::
FramelessWindowHint
|
f
)
,
version
(
version
)
,
pixmap
(
pixmap
)
{
setupUi
(
this
);
lblSplash
->
setPixmap
(
pixmap
);
bnClose
->
hide
();
connect
(
bnClose
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
close
()));
chkShowAtStartup
->
hide
();
connect
(
chkShowAtStartup
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
toggleShowAtStartup
(
bool
)));
KConfigGroup
cfg
(
KGlobal
::
config
(),
"SplashScreen"
);
bool
hideSplash
=
cfg
.
readEntry
(
"HideSplashAfterStartup"
,
false
);
chkShowAtStartup
->
setChecked
(
hideSplash
);
lblLinks
->
setTextFormat
(
Qt
::
RichText
);
lblLinks
->
setText
(
"<html>"
"<head/>"
"<body>"
"<p align=
\"
center
\"
><b>Links</b></p>"
"<p><a href=
\"
http://krita.org/support-krita#general
\"
><span style=
\"
text-decoration: underline;
\"
>Donations</span></a></p>"
"<p><a href=
\"
http://www.zazzle.com/kritashop
\"
><span style=
\"
text-decoration: underline;
\"
>Shop</span></a></p>"
"<p><a href=
\"
http://krita.org/resources
\"
><span style=
\"
text-decoration: underline;
\"
>Getting Started</span></a></p>"
"<p><a href=
\"
http://krita.org
\"
><span style=
\"
text-decoration: underline;
\"
>Website</span></a></p>"
"<p><a href=
\"
http://kritastudio.com
\"
><span style=
\"
text-decoration: underline;
\"
>Commercial Support</span></a></p>"
"<p><a href=
\"
http://forum.kde.org/viewforum.php?f=136
\"
><span style=
\"
text-decoration: underline;
\"
>User Community</span></a></p>"
"<p><a href=
\"
https://projects.kde.org/projects/calligra
\"
><span style=
\"
text-decoration: underline;
\"
>Source Code</span></a></p>"
"<p><a href=
\"
http://store.steampowered.com/app/280680/
\"
><span style=
\"
text-decoration: underline;
\"
>Get Krita on Steam</span></a></p>"
"</body>"
"</html>"
);
lblVersion
->
setText
(
i18n
(
"Version: %1"
,
version
));
}
void
KisSplashScreen
::
repaint
()
{
QWidget
::
repaint
();
QApplication
::
flush
();
}
void
KisSplashScreen
::
show
()
{
QRect
r
(
QPoint
(),
sizeHint
());
resize
(
r
.
size
());
move
(
QApplication
::
desktop
()
->
screenGeometry
().
center
()
-
r
.
center
());
if
(
isVisible
())
{
repaint
();
}
}
void
KisSplashScreen
::
toggleShowAtStartup
(
bool
toggle
)
{
KConfigGroup
cfg
(
KGlobal
::
config
(),
"SplashScreen"
);
cfg
.
writeEntry
(
"HideSplashAfterStartup"
,
toggle
);
}
krita/kis_splash_screen.h
View file @
eff5fa3f
...
...
@@ -21,16 +21,25 @@
#include <QWidget>
#include "ui_wdgsplash.h"
class
QPixmap
;
class
KisSplashScreen
:
public
QWidget
,
public
Ui
::
WdgSplash
{
Q_OBJECT
public:
explicit
KisSplashScreen
(
QWidget
*
parent
=
0
);
explicit
KisSplashScreen
(
const
QString
&
version
,
const
QPixmap
&
pixmap
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
f
=
0
);
void
repaint
();
void
show
();
signal
s:
private
slot
s
:
public
slots
:
void
toggleShowAtStartup
(
bool
toggle
);
private:
QString
version
;
QPixmap
pixmap
;
};
#endif // KIS_SPLASH_SCREEN_H
krita/main.cc
View file @
eff5fa3f
...
...
@@ -97,7 +97,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
// then create the pixmap from an xpm: we cannot get the
// location of our datadir before we've started our components,
// so use an xpm.
QWidget
*
splash
=
new
KisSplashScreen
();
QWidget
*
splash
=
new
KisSplashScreen
(
aboutData
->
version
(),
QPixmap
(
splash_screen_xpm
)
);
app
.
setSplashScreen
(
splash
);
if
(
!
app
.
start
())
{
...
...
krita/wdgsplash.ui
View file @
eff5fa3f
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
440
</width>
<height>
5
25
</height>
<height>
5
71
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -16,43 +16,6 @@
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"palette"
>
<palette>
<active>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
40
</red>
<green>
40
</green>
<blue>
40
</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
40
</red>
<green>
40
</green>
<blue>
40
</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
250
</red>
<green>
250
</green>
<blue>
250
</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
...
...
@@ -69,7 +32,7 @@
<bool>
true
</bool>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"
Preferr
ed"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"
Fix
ed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
...
...
@@ -77,7 +40,7 @@
<property
name=
"minimumSize"
>
<size>
<width>
440
</width>
<height>
0
</height>
<height>
286
</height>
</size>
</property>
<property
name=
"text"
>
...
...
@@ -94,7 +57,13 @@
<item>
<widget
class=
"QLabel"
name=
"lblVersion"
>
<property
name=
"text"
>
<string>
Version 2.8.1 (d73aa83)
</string>
<string>
TextLabel
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"margin"
>
<number>
4
</number>
</property>
</widget>
</item>
...
...
@@ -107,7 +76,7 @@
<number>
10
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
2
0
</number>
<number>
0
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"lblLinks"
>
...
...
@@ -115,7 +84,7 @@
<string
notr=
"true"
/>
</property>
<property
name=
"text"
>
<string>
<
html
><
head/
><
body
><
p align=
"
center
">
Links
<
/p
><
p
><
a href=
"
http://krita.org/support-krita#general
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Donations
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://www.zazzle.com/kritashop
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Shop
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://krita.org/resources
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Getting Started
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://krita.org
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Website
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://kritastudio.com
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Commercial Support
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://forum.kde.org/viewforum.php?f=136
"><
span style=
"
text-decoration: underline; color:#006e28;
">
User Community
<
/span
><
/a
><
/p
><
p
><
a href=
"
https://projects.kde.org/projects/calligra
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Source Code
<
/span
><
/a
><
/p
><
/body
><
/html
>
</string>
<string>
<
html
><
head/
><
body
><
p align=
"
center
">
<
span style=
"
font-weight:600;
">
Links
<
/span
><
/p
><
p
><
a href=
"
http://krita.org/support-krita#general
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Donations
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://www.zazzle.com/kritashop
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Shop
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://krita.org/resources
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Getting Started
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://krita.org
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Website
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://kritastudio.com
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Commercial Support
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://forum.kde.org/viewforum.php?f=136
"><
span style=
"
text-decoration: underline; color:#006e28;
">
User Community
<
/span
><
/a
><
/p
><
p
><
a href=
"
https://projects.kde.org/projects/calligra
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Source Code
<
/span
><
/a
><
/p
><
p
><
a href=
"
http://store.steampowered.com/app/280680/
"><
span style=
"
text-decoration: underline; color:#006e28;
">
Get Krita on Steam
<
/span
><
/a
><
/p
><
/body
><
/html
>
</string>
</property>
<property
name=
"textFormat"
>
<enum>
Qt::RichText
</enum>
...
...
@@ -131,7 +100,7 @@
<item>
<widget
class=
"QLabel"
name=
"lblRecent"
>
<property
name=
"text"
>
<string>
Recent files
</string>
<string>
<
html
><
head/
><
body
><
p align=
"
center
"><
span style=
"
font-weight:600;
">
Recent files
<
/span
><
/p
><
/body
><
/html
>
</string>
</property>
<property
name=
"textFormat"
>
<enum>
Qt::RichText
</enum>
...
...
@@ -146,6 +115,42 @@
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<property
name=
"leftMargin"
>
<number>
4
</number>
</property>
<property
name=
"topMargin"
>
<number>
2
</number>
</property>
<property
name=
"rightMargin"
>
<number>
4
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
10
</number>
</property>
<item>
<widget
class=
"QCheckBox"
name=
"chkShowAtStartup"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Hide after startup.
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"bnClose"
>
<property
name=
"text"
>
<string>
&
Close
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
...
...
libs/main/KoApplication.cpp
View file @
eff5fa3f
...
...
@@ -46,6 +46,9 @@
#include <kiconloader.h>
#include <kdebug.h>
#include <kmimetype.h>
#include <kconfig.h>
#include <kglobal.h>
#include <kconfiggroup.h>
#if KDE_IS_VERSION(4,6,0)
#include <krecentdirs.h>
...
...
@@ -66,6 +69,9 @@
#include <tchar.h>
#endif
#include <QDesktopWidget>
KoApplication
*
KoApplication
::
KoApp
=
0
;
namespace
{
...
...
@@ -93,9 +99,27 @@ public:
~
ResetStarting
()
{
if
(
m_splash
)
{
m_splash
->
hide
();
delete
m_splash
;
m_splash
=
0
;
KConfigGroup
cfg
(
KGlobal
::
config
(),
"SplashScreen"
);
bool
hideSplash
=
cfg
.
readEntry
(
"HideSplashAfterStartup"
,
false
);
if
(
hideSplash
)
{
m_splash
->
hide
();
}
else
{
m_splash
->
setWindowFlags
(
Qt
::
Dialog
|
Qt
::
FramelessWindowHint
);
m_splash
->
setWindowModality
(
Qt
::
ApplicationModal
);
m_splash
->
setParent
(
qApp
->
activeWindow
());
QRect
r
(
QPoint
(),
m_splash
->
size
());
m_splash
->
move
(
QApplication
::
desktop
()
->
screenGeometry
().
center
()
-
r
.
center
());
m_splash
->
show
();
foreach
(
QObject
*
o
,
m_splash
->
children
())
{
QWidget
*
w
=
qobject_cast
<
QWidget
*>
(
o
);
if
(
w
&&
w
->
isHidden
())
{
w
->
setVisible
(
true
);
}
}
}
}
}
...
...
@@ -223,7 +247,7 @@ bool KoApplication::start()
if
(
d
->
splashScreen
)
{
d
->
splashScreen
->
show
();
//d->splashScreen->showMessage("."
);
d
->
splashScreen
->
repaint
(
);
}
ResetStarting
resetStarting
(
d
->
splashScreen
);
// remove the splash when done
...
...
@@ -581,6 +605,13 @@ QList<KoPart*> KoApplication::partList() const
return
d
->
partList
;
}
void
KoApplication
::
removeSplash
()
{
d
->
splashScreen
->
hide
();
delete
d
->
splashScreen
;
d
->
splashScreen
=
0
;
}
QStringList
KoApplication
::
mimeFilter
(
KoFilterManager
::
Direction
direction
)
const
{
KoDocumentEntry
entry
=
KoDocumentEntry
::
queryByMimeType
(
d
->
nativeMimeType
);
...
...
libs/main/KoApplication.h
View file @
eff5fa3f
...
...
@@ -87,6 +87,11 @@ public:
QList
<
KoPart
*>
partList
()
const
;
/**
* Remove the splash dialog
*/
void
removeSplash
();
/**
* return a list of mimetypes this application supports.
*/
...
...
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