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
Marco Bubke
flatpak-qt-creator
Commits
d13dfe44
Commit
d13dfe44
authored
Mar 12, 2010
by
mae
Browse files
Some tuning of the fancy action bar
Done-with: jbache
parent
a2fe486b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/fancyactionbar.cpp
View file @
d13dfe44
...
...
@@ -57,10 +57,17 @@ using namespace Internal;
FancyToolButton
::
FancyToolButton
(
QWidget
*
parent
)
:
QToolButton
(
parent
),
m_fader
(
0
)
{
m_hasForceVisible
=
false
;
setAttribute
(
Qt
::
WA_Hover
,
true
);
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Preferred
);
}
void
FancyToolButton
::
forceVisible
(
bool
visible
)
{
m_hasForceVisible
=
true
;
setVisible
(
visible
);
}
bool
FancyToolButton
::
event
(
QEvent
*
e
)
{
switch
(
e
->
type
())
{
...
...
@@ -220,8 +227,10 @@ void FancyToolButton::actionChanged()
{
// the default action changed in some way, e.g. it might got hidden
// since we inherit a tool button we won't get invisible, so do this here
if
(
QAction
*
action
=
defaultAction
())
setVisible
(
action
->
isVisible
());
if
(
!
m_hasForceVisible
)
{
if
(
QAction
*
action
=
defaultAction
())
setVisible
(
action
->
isVisible
());
}
}
FancyActionBar
::
FancyActionBar
(
QWidget
*
parent
)
...
...
@@ -270,8 +279,8 @@ void FancyActionBar::modeChanged(Core::IMode *mode)
if
(
m_runButton
&&
m_debugButton
)
{
bool
inDebugMode
=
(
mode
->
id
()
==
QLatin1String
(
"Debugger.Mode.Debug"
));
layout
()
->
setEnabled
(
false
);
m_runButton
->
set
Visible
(
!
inDebugMode
);
m_debugButton
->
set
Visible
(
inDebugMode
);
m_runButton
->
force
Visible
(
!
inDebugMode
);
m_debugButton
->
force
Visible
(
inDebugMode
);
layout
()
->
setEnabled
(
true
);
}
}
...
...
src/plugins/coreplugin/fancyactionbar.h
View file @
d13dfe44
...
...
@@ -60,8 +60,13 @@ public:
float
fader
()
{
return
m_fader
;
}
void
setFader
(
float
value
)
{
m_fader
=
value
;
update
();
}
void
forceVisible
(
bool
visible
);
private
slots
:
void
actionChanged
();
private:
bool
m_hasForceVisible
;
};
class
FancyActionBar
:
public
QWidget
...
...
src/plugins/coreplugin/progressmanager/futureprogress.cpp
View file @
d13dfe44
...
...
@@ -44,6 +44,8 @@
using
namespace
Core
;
const
int
notificationTimeout
=
8000
;
void
FadeWidgetHack
::
paintEvent
(
QPaintEvent
*
)
{
if
(
m_opacity
==
0
)
...
...
@@ -187,7 +189,7 @@ bool FutureProgress::eventFilter(QObject *, QEvent *e)
if
(
m_waitingForUserInteraction
&&
(
e
->
type
()
==
QEvent
::
MouseMove
||
e
->
type
()
==
QEvent
::
KeyPress
))
{
qApp
->
removeEventFilter
(
this
);
QTimer
::
singleShot
(
5000
,
this
,
SLOT
(
fadeAway
()));
QTimer
::
singleShot
(
notificationTimeout
,
this
,
SLOT
(
fadeAway
()));
}
return
false
;
}
...
...
@@ -205,7 +207,7 @@ void FutureProgress::setFinished()
m_waitingForUserInteraction
=
true
;
qApp
->
installEventFilter
(
this
);
}
else
{
QTimer
::
singleShot
(
5000
,
this
,
SLOT
(
fadeAway
()));
QTimer
::
singleShot
(
notificationTimeout
,
this
,
SLOT
(
fadeAway
()));
}
}
...
...
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