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
KRuler
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
Graphics
KRuler
Commits
63f6bbe9
Commit
63f6bbe9
authored
Jun 14, 2017
by
Aurélien Gâteau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove buttons
parent
00a46155
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
108 deletions
+2
-108
cfg_appearance.ui
cfg_appearance.ui
+0
-14
klineal.cpp
klineal.cpp
+2
-83
klineal.h
klineal.h
+0
-3
kruler.kcfg
kruler.kcfg
+0
-8
No files found.
cfg_appearance.ui
View file @
63f6bbe9
...
...
@@ -41,20 +41,6 @@
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QCheckBox" name="kcfg_RotateButtonsVisible" >
<property name="text" >
<string>Show rotation buttons</string>
</property>
</widget>
</item>
<item row="5" column="1" >
<widget class="QCheckBox" name="kcfg_CloseButtonVisible" >
<property name="text" >
<string>Show close button</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
...
...
klineal.cpp
View file @
63f6bbe9
...
...
@@ -91,7 +91,6 @@ KLineal::KLineal( QWidget *parent )
mOffsetAction
(
0
),
mClicked
(
false
),
mActionCollection
(
0
),
mCloseButton
(
0
),
mTrayIcon
(
0
)
{
setAttribute
(
Qt
::
WA_TranslucentBackground
);
...
...
@@ -127,16 +126,6 @@ KLineal::KLineal( QWidget *parent )
mLabel
->
setGeometry
(
0
,
height
()
-
12
,
32
,
12
);
mLabel
->
setWhatsThis
(
i18n
(
"This is the current distance measured in pixels."
)
);
mBtnRotateLeft
=
new
QToolButton
(
this
);
mBtnRotateLeft
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"object-rotate-left"
)
)
);
mBtnRotateLeft
->
setToolTip
(
i18n
(
"Turn Left"
)
);
connect
(
mBtnRotateLeft
,
&
QToolButton
::
clicked
,
this
,
&
KLineal
::
turnLeft
);
mBtnRotateRight
=
new
QToolButton
(
this
);
mBtnRotateRight
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"object-rotate-right"
)
)
);
mBtnRotateRight
->
setToolTip
(
i18n
(
"Turn Right"
)
);
connect
(
mBtnRotateRight
,
&
QToolButton
::
clicked
,
this
,
&
KLineal
::
turnRight
);
resize
(
QSize
(
mLongEdgeLen
,
mShortEdgeLen
)
);
//BEGIN setup menu and actions
...
...
@@ -227,17 +216,8 @@ KLineal::~KLineal()
void
KLineal
::
createSystemTray
()
{
if
(
!
mCloseAction
)
{
mCloseAction
=
mActionCollection
->
addAction
(
KStandardAction
::
Close
,
this
,
SLOT
(
slotClose
())
);
mMenu
->
addAction
(
mCloseAction
);
mCloseButton
=
new
QToolButton
(
this
);
mCloseButton
->
setIcon
(
mCloseAction
->
icon
()
);
mCloseButton
->
setToolTip
(
mCloseAction
->
text
().
remove
(
QLatin1Char
(
'&'
)
)
);
connect
(
mCloseButton
,
&
QToolButton
::
clicked
,
this
,
&
KLineal
::
slotClose
);
}
else
{
mCloseAction
->
setVisible
(
true
);
}
mCloseAction
=
mActionCollection
->
addAction
(
KStandardAction
::
Close
,
this
,
SLOT
(
slotClose
())
);
mMenu
->
addAction
(
mCloseAction
);
if
(
!
mTrayIcon
)
{
mTrayIcon
=
new
KRulerSystemTray
(
QStringLiteral
(
"kruler"
),
this
,
mActionCollection
);
...
...
@@ -393,8 +373,6 @@ void KLineal::setOrientation( int inOrientation )
break
;
}
adjustButtons
();
if
(
mLenMenu
&&
mFullScreenAction
)
{
mFullScreenAction
->
setText
(
mOrientation
%
2
?
i18n
(
"&Full Screen Height"
)
:
i18n
(
"&Full Screen Width"
)
);
}
...
...
@@ -460,7 +438,6 @@ void KLineal::reLength( int percentOfScreen )
move
(
x
(),
10
);
}
adjustButtons
();
saveSettings
();
}
...
...
@@ -485,7 +462,6 @@ void KLineal::reLengthAbsolute( int length )
move
(
x
(),
10
);
}
adjustButtons
();
saveSettings
();
}
...
...
@@ -590,7 +566,6 @@ void KLineal::slotPreferences()
Ui
::
ConfigAppearance
appearanceConfig
;
QWidget
*
appearanceConfigWidget
=
new
QWidget
(
dialog
);
appearanceConfig
.
setupUi
(
appearanceConfigWidget
);
appearanceConfig
.
kcfg_CloseButtonVisible
->
setEnabled
(
appearanceConfig
.
kcfg_TrayIcon
->
isChecked
()
);
dialog
->
addPage
(
appearanceConfigWidget
,
i18n
(
"Appearance"
),
QStringLiteral
(
"preferences-desktop-default-applications"
)
);
#ifdef KRULER_HAVE_X11
...
...
@@ -621,8 +596,6 @@ void KLineal::loadConfig()
if
(
RulerSettings
::
self
()
->
trayIcon
()
)
{
if
(
!
mTrayIcon
)
{
createSystemTray
();
//need to adjust button
adjustButtons
();
}
}
else
{
delete
mTrayIcon
;
...
...
@@ -705,15 +678,6 @@ void KLineal::showLabel()
{
adjustLabel
();
mLabel
->
show
();
if
(
RulerSettings
::
self
()
->
rotateButtonsVisible
()
)
{
mBtnRotateLeft
->
show
();
mBtnRotateRight
->
show
();
}
if
(
mCloseButton
&&
RulerSettings
::
self
()
->
closeButtonVisible
()
&&
RulerSettings
::
self
()
->
trayIcon
())
{
mCloseButton
->
show
();
}
}
/**
...
...
@@ -722,11 +686,6 @@ void KLineal::showLabel()
void
KLineal
::
hideLabel
()
{
mLabel
->
hide
();
mBtnRotateLeft
->
hide
();
mBtnRotateRight
->
hide
();
if
(
mCloseButton
)
{
mCloseButton
->
hide
();
}
}
/**
...
...
@@ -758,46 +717,6 @@ void KLineal::adjustLabel()
mLabel
->
setText
(
s
);
}
/**
* Updates the position of the tool buttons
*/
void
KLineal
::
adjustButtons
()
{
switch
(
mOrientation
)
{
case
North
:
mBtnRotateLeft
->
move
(
mLongEdgeLen
/
2
-
28
,
height
()
-
31
);
mBtnRotateRight
->
move
(
mLongEdgeLen
/
2
+
2
,
height
()
-
31
);
if
(
mCloseButton
)
{
mCloseButton
->
move
(
width
()
-
31
,
height
()
-
31
);
}
break
;
case
South
:
mBtnRotateLeft
->
move
(
mLongEdgeLen
/
2
-
28
,
5
);
mBtnRotateRight
->
move
(
mLongEdgeLen
/
2
+
2
,
5
);
if
(
mCloseButton
)
{
mCloseButton
->
move
(
width
()
-
31
,
5
);
}
break
;
case
East
:
mBtnRotateLeft
->
move
(
5
,
mLongEdgeLen
/
2
-
28
);
mBtnRotateRight
->
move
(
5
,
mLongEdgeLen
/
2
+
2
);
if
(
mCloseButton
)
{
mCloseButton
->
move
(
5
,
height
()
-
31
);
}
break
;
case
West
:
mBtnRotateLeft
->
move
(
width
()
-
31
,
mLongEdgeLen
/
2
-
28
);
mBtnRotateRight
->
move
(
width
()
-
31
,
mLongEdgeLen
/
2
+
2
);
if
(
mCloseButton
)
{
mCloseButton
->
move
(
width
()
-
31
,
height
()
-
31
);
}
break
;
}
}
void
KLineal
::
keyPressEvent
(
QKeyEvent
*
e
)
{
QPoint
dist
;
...
...
klineal.h
View file @
63f6bbe9
...
...
@@ -95,8 +95,6 @@ private:
bool
mRelativeScale
;
KActionCollection
*
mActionCollection
;
int
mOpacity
;
QToolButton
*
mBtnRotateLeft
,
*
mBtnRotateRight
;
QToolButton
*
mCloseButton
;
KRulerSystemTray
*
mTrayIcon
;
public
slots
:
...
...
@@ -111,7 +109,6 @@ public slots:
void
hideLabel
();
void
showLabel
();
void
adjustLabel
();
void
adjustButtons
();
void
setShortLength
();
void
setMediumLength
();
void
setTallLength
();
...
...
kruler.kcfg
View file @
63f6bbe9
...
...
@@ -40,14 +40,6 @@
<label>
Opacity of the window
</label>
<default>
255
</default>
</entry>
<entry
name=
"RotateButtonsVisible"
type=
"Bool"
>
<label>
Are the rotate buttons visible
</label>
<default>
false
</default>
</entry>
<entry
name=
"CloseButtonVisible"
type=
"Bool"
>
<label>
Is the close button visible
</label>
<default>
false
</default>
</entry>
<entry
name=
"NativeMoving"
type=
"Bool"
>
<label>
Is native moving (possibly wobbling windows) active
</label>
<default>
false
</default>
...
...
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