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
P
Plasma Phone Components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
26
Issues
26
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Plasma
Plasma Phone Components
Commits
220f4f79
Commit
220f4f79
authored
Sep 03, 2016
by
Marco Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the close button
use the c++ part aain for hasCloseableActiveWindow
parent
f97c377b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
containments/taskpanel/package/contents/ui/main.qml
containments/taskpanel/package/contents/ui/main.qml
+1
-1
containments/taskpanel/taskpanel.cpp
containments/taskpanel/taskpanel.cpp
+10
-3
containments/taskpanel/taskpanel.h
containments/taskpanel/taskpanel.h
+1
-0
No files found.
containments/taskpanel/package/contents/ui/main.qml
View file @
220f4f79
...
...
@@ -143,7 +143,7 @@ PlasmaCore.ColorScope {
anchors.right
:
parent
.
right
iconSource
:
"
window-close
"
//FIXME:Qt.UserRole+9 is IsWindow Qt.UserRole+15 is IsClosable. We can't reach that enum from QML
enabled
:
taskSwitcher
.
model
?
(
taskSwitcher
.
model
.
data
(
taskSwitcher
.
model
.
activeTask
,
Qt
.
UserRole
+
9
)
===
true
&&
taskSwitcher
.
model
.
data
(
taskSwitcher
.
model
.
activeTask
,
Qt
.
UserRole
+
15
)
===
true
)
:
false
enabled
:
plasmoid
.
nativeInterface
.
hasCloseableActiveWindow
onClicked
:
{
var
index
=
taskSwitcher
.
model
.
activeTask
;
if
(
index
)
{
...
...
containments/taskpanel/taskpanel.cpp
View file @
220f4f79
...
...
@@ -42,6 +42,10 @@ TaskPanel::TaskPanel(QObject *parent, const QVariantList &args)
{
setHasConfigurationInterface
(
true
);
initWayland
();
m_activeTimer
=
new
QTimer
(
this
);
m_activeTimer
->
setSingleShot
(
true
);
m_activeTimer
->
setInterval
(
250
);
connect
(
m_activeTimer
,
&
QTimer
::
timeout
,
this
,
&
TaskPanel
::
updateActiveWindow
);
}
TaskPanel
::~
TaskPanel
()
...
...
@@ -81,7 +85,10 @@ void TaskPanel::initWayland()
emit
showingDesktopChanged
(
m_showingDesktop
);
}
);
connect
(
m_windowManagement
,
&
PlasmaWindowManagement
::
activeWindowChanged
,
this
,
&
TaskPanel
::
updateActiveWindow
);
//FIXME
//connect(m_windowManagement, &PlasmaWindowManagement::activeWindowChanged, this, &TaskPanel::updateActiveWindow, Qt::QueuedConnection);
connect
(
m_windowManagement
,
SIGNAL
(
activeWindowChanged
()),
m_activeTimer
,
SLOT
(
start
()));
updateActiveWindow
();
}
);
...
...
@@ -132,7 +139,7 @@ void TaskPanel::setPanel(QWindow *panel)
void
TaskPanel
::
updateActiveWindow
()
{
if
(
!
m_windowManagement
)
{
if
(
!
m_windowManagement
||
m_activeWindow
==
m_windowManagement
->
activeWindow
()
)
{
return
;
}
if
(
m_activeWindow
)
{
...
...
@@ -154,7 +161,7 @@ void TaskPanel::updateActiveWindow()
bool
TaskPanel
::
hasCloseableActiveWindow
()
const
{
return
m_activeWindow
&&
m_activeWindow
->
isCloseable
()
&&
!
m_activeWindow
->
isMinimized
()
;
return
m_activeWindow
&&
m_activeWindow
->
isCloseable
()
/*&& !m_activeWindow->isMinimized()*/
;
}
void
TaskPanel
::
forgetActiveWindow
()
...
...
containments/taskpanel/taskpanel.h
View file @
220f4f79
...
...
@@ -80,6 +80,7 @@ private:
KWayland
::
Client
::
PlasmaWindowManagement
*
m_windowManagement
=
nullptr
;
KWayland
::
Client
::
PlasmaWindowModel
*
m_windowModel
=
nullptr
;
QPointer
<
KWayland
::
Client
::
PlasmaWindow
>
m_activeWindow
;
QTimer
*
m_activeTimer
;
};
#endif
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