Unverified Commit b93ba442 authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Remove native moving option



Disabling this option is not gonna work and it would be preferable to
tell kwin to not add effect on kruler instead

Signed-off-by: Carl Schwan's avatarCarl Schwan <carl@carlschwan.eu>
parent 11704d5e
......@@ -17,16 +17,6 @@
<property name="margin" >
<number>0</number>
</property>
<item row="1" column="1" >
<widget class="QCheckBox" name="kcfg_NativeMoving" >
<property name="toolTip" >
<string>If this option is enabled, the window is being moved using the operations from the window manager.</string>
</property>
<property name="text" >
<string>Native moving</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="kcfg_AlwaysOnTop" >
<property name="toolTip" >
......
......@@ -181,6 +181,7 @@ KLineal::KLineal( QWidget *parent )
KLineal::~KLineal()
{
saveSettings();
delete mTrayIcon;
}
......@@ -501,11 +502,6 @@ void KLineal::showMenu()
mMenu->popup( pos );
}
bool KLineal::isResizing() const
{
return mouseGrabber() == this && ( mRulerState == StateBegin || mRulerState == StateEnd );
}
int KLineal::length() const
{
return mHorizontal ? width() : height();
......@@ -600,14 +596,12 @@ void KLineal::mousePressEvent( QMouseEvent *inEvent )
QRect gr = geometry();
mDragOffset = mLastClickPos - gr.topLeft();
if ( inEvent->button() == Qt::LeftButton ) {
if ( mRulerState < StateMove ) {
if ( beginRect().contains( mDragOffset ) ) {
windowHandle()->startSystemResize(mHorizontal ? Qt::LeftEdge : Qt::TopEdge);
} else if ( endRect().contains( mDragOffset ) ) {
windowHandle()->startSystemResize(mHorizontal ? Qt::RightEdge : Qt::BottomEdge);
} else {
windowHandle()->startSystemMove();
}
if ( beginRect().contains( mDragOffset ) ) {
windowHandle()->startSystemResize(mHorizontal ? Qt::LeftEdge : Qt::TopEdge);
} else if ( endRect().contains( mDragOffset ) ) {
windowHandle()->startSystemResize(mHorizontal ? Qt::RightEdge : Qt::BottomEdge);
} else {
windowHandle()->startSystemMove();
}
} else if ( inEvent->button() == Qt::MiddleButton ) {
mClicked = true;
......@@ -842,7 +836,7 @@ void KLineal::paintEvent(QPaintEvent *inEvent )
drawResizeHandle( painter, mHorizontal ? Qt::LeftEdge : Qt::TopEdge );
drawResizeHandle( painter, mHorizontal ? Qt::RightEdge : Qt::BottomEdge );
if ( underMouse() && !isResizing() ) {
if ( underMouse() ) {
int xy = mHorizontal ? localCursorPos().x() : localCursorPos().y();
drawIndicatorOverlay( painter, xy );
drawIndicatorText( painter, xy );
......
......@@ -57,16 +57,12 @@ private:
QRect beginRect() const;
QRect endRect() const;
Qt::CursorShape resizeCursor() const;
bool nativeMove() const;
void startNativeMove( QMouseEvent *e );
void stopNativeMove( QMouseEvent *e );
QString indicatorText() const;
enum RulerState {
StateNone,
StateMove,
StateBegin,
StateEnd
};
QCursor mCrossCursor;
RulerState mRulerState = StateNone;
QPoint mLastClickPos;
QPoint mDragOffset;
bool mHorizontal = false;
......@@ -89,7 +85,6 @@ private:
void setHorizontal( bool horizontal );
bool isResizing() const;
int length() const;
QPoint localCursorPos() const;
qreal pixelRatio() const;
......
......@@ -43,10 +43,6 @@
<label>Opacity of the window</label>
<default>255</default>
</entry>
<entry name="NativeMoving" type="Bool">
<label>Is native moving (possibly wobbling windows) active</label>
<default>false</default>
</entry>
<entry name="AlwaysOnTop" type="Bool">
<label>Is always on top</label>
<default>true</default>
......
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