Commit e9622a33 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port away from deprecated Qt API

- QFlags::Zero is deprecated, use default construtor instead
- Replace PE_FrameStatusBar with PE_FrameStatusBarItem
- QPalette::Background to QPalette::Window
- Use QElapsedTimer
parent da71353c
Pipeline #161892 passed with stage
in 1 minute and 51 seconds
......@@ -106,7 +106,7 @@ namespace Oxygen
if( className.isEmpty() )
{
// retrieve class name
KWindowInfo info( clientPtr->windowId(), 0, NET::WM2WindowClass );
KWindowInfo info( clientPtr->windowId(), {}, NET::WM2WindowClass );
QString window_className( QString::fromUtf8(info.windowClassName()) );
QString window_class( QString::fromUtf8(info.windowClassClass()) );
className = window_className + QStringLiteral(" ") + window_class;
......
......@@ -1008,7 +1008,7 @@ namespace Oxygen
case PE_IndicatorToolBarSeparator: fcn = &Style::drawIndicatorToolBarSeparatorPrimitive; break;
case PE_IndicatorBranch: fcn = &Style::drawIndicatorBranchPrimitive; break;
case PE_IndicatorDockWidgetResizeHandle: fcn = &Style::drawIndicatorDockWidgetResizeHandlePrimitive; break;
case PE_FrameStatusBar: fcn = &Style::emptyPrimitive; break;
case PE_FrameStatusBarItem: fcn = &Style::emptyPrimitive; break;
case PE_Frame: fcn = &Style::drawFramePrimitive; break;
case PE_FrameLineEdit: fcn = &Style::drawFrameLineEditPrimitive; break;
case PE_FrameMenu: fcn = &Style::drawFrameMenuPrimitive; break;
......
......@@ -243,7 +243,7 @@ namespace Oxygen
{
QPalette out( source );
out.setColor( QPalette::Window, KColorUtils::mix( source.color( QPalette::Active, QPalette::Background ), source.color( QPalette::Disabled, QPalette::Background ), 1.0-ratio ) );
out.setColor( QPalette::Window, KColorUtils::mix( source.color( QPalette::Active, QPalette::Window ), source.color( QPalette::Disabled, QPalette::Window ), 1.0-ratio ) );
out.setColor( QPalette::Highlight, KColorUtils::mix( source.color( QPalette::Active, QPalette::Highlight ), source.color( QPalette::Disabled, QPalette::Highlight ), 1.0-ratio ) );
out.setColor( QPalette::WindowText, KColorUtils::mix( source.color( QPalette::Active, QPalette::WindowText ), source.color( QPalette::Disabled, QPalette::WindowText ), 1.0-ratio ) );
out.setColor( QPalette::ButtonText, KColorUtils::mix( source.color( QPalette::Active, QPalette::ButtonText ), source.color( QPalette::Disabled, QPalette::ButtonText ), 1.0-ratio ) );
......
......@@ -13,6 +13,7 @@
#include "oxygentransitionwidget.h"
#include <QElapsedTimer>
#include <QObject>
#include <QTime>
#include <QWidget>
......@@ -60,13 +61,16 @@ namespace Oxygen
//* start clock
void startClock( void )
{
if( _clock.isNull() ) _clock.start();
else _clock.restart();
if( !_timer.isValid() ) {
_timer.start();
} else {
_timer.restart();
}
}
//* check if rendering is two slow
//* check if rendering is too slow
bool slow( void ) const
{ return !( _clock.isNull() || _clock.elapsed() <= maxRenderTime() ); }
{ return _timer.isValid() && _timer.elapsed() > maxRenderTime(); }
protected Q_SLOTS:
......@@ -102,7 +106,7 @@ namespace Oxygen
bool _recursiveCheck = false;
//* timer used to detect slow rendering
QTime _clock;
QElapsedTimer _timer;
//* max render time
/** used to detect slow rendering */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment