Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Filelight
Commits
e671ce9c
Commit
e671ce9c
authored
Aug 23, 2020
by
Martin Tobias Holmedahl Sandsmark
Browse files
clean up updates from settings dialog to map redraw
parent
897a840e
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/Config.h
View file @
e671ce9c
...
...
@@ -26,6 +26,14 @@
class
KConfig
;
enum
class
Dirty
{
Layout
=
1
,
AntiAliasing
=
2
,
Colors
=
3
,
Font
};
namespace
Filelight
{
enum
MapScheme
{
Rainbow
,
KDE
,
HighContrast
,
FileDensity
,
ModTime
};
...
...
src/radialMap/radialMap.h
View file @
e671ce9c
...
...
@@ -24,20 +24,6 @@
#include <QColor>
enum
class
Dirty
{
Other
=
0
,
LayoutChanged
=
1
,
// Antialias on or off, contrast changed
RepaintNeeded
=
2
,
ColorsChanged
=
3
,
RepaintNeeded2
=
4
,
};
class
File
;
namespace
RadialMap
...
...
src/radialMap/widget.cpp
View file @
e671ce9c
...
...
@@ -32,6 +32,7 @@
#include <QApplication> //sendEvent
#include <QBitmap> //ctor - finding cursor size
#include <QCursor> //slotPostMouseEvent()
#include <QDebug>
#include <QTimer> //member
#include <QWidget>
...
...
@@ -168,21 +169,27 @@ RadialMap::Widget::refresh(const Dirty filth)
{
switch
(
filth
)
{
case
Dirty
::
Layout
Changed
:
m_focus
=
nullptr
;
case
Dirty
::
Layout
:
m_focus
=
nullptr
;
m_map
.
make
(
m_tree
,
true
);
//true means refresh only
break
;
case
Dirty
::
RepaintNeeded
:
case
Dirty
::
AntiAliasing
:
m_map
.
paint
();
break
;
case
Dirty
::
ColorsChanged
:
m_map
.
colorise
();
//FALL THROUGH!
case
Dirty
::
RepaintNeeded2
:
case
Dirty
::
Colors
:
m_map
.
colorise
();
m_map
.
paint
();
break
;
// At the time of writing only used by the exploded labels
// which is redrawn with each paintEvent(), so just need an update()
case
Dirty
::
Font
:
break
;
default:
qWarning
()
<<
"Unhandled filth type"
<<
int
(
filth
);
break
;
}
...
...
src/radialMap/widget.h
View file @
e671ce9c
...
...
@@ -35,7 +35,7 @@
#include <QTimer>
#include "map.h"
#include "
radialMap
.h" // Dirty
#include "
Config
.h" // Dirty
class
Folder
;
class
File
;
...
...
src/settingsDialog.cpp
View file @
e671ce9c
...
...
@@ -67,7 +67,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent)
connect
(
m_schemaGroup
,
static_cast
<
void
(
QButtonGroup
::*
)(
QAbstractButton
*
)
>
(
&
QButtonGroup
::
buttonClicked
),
this
,
&
SettingsDialog
::
changeScheme
);
connect
(
contrastSlider
,
&
QSlider
::
valueChanged
,
this
,
&
SettingsDialog
::
changeContrast
);
connect
(
contrastSlider
,
&
QSlider
::
sliderReleased
,
this
,
&
SettingsDialog
::
slotSliderReleased
);
connect
(
scanAcrossMounts
,
&
QCheckBox
::
toggled
,
this
,
&
SettingsDialog
::
startTimer
);
connect
(
dontScanRemoteMounts
,
&
QCheckBox
::
toggled
,
this
,
&
SettingsDialog
::
startTimer
);
...
...
@@ -206,44 +205,37 @@ void SettingsDialog::changeScheme(QAbstractButton *button)
if
(
button
)
{
const
int
s
=
m_schemaGroup
->
id
(
button
);
Config
::
scheme
=
(
Filelight
::
MapScheme
)
s
;
Q_EMIT
canvasIsDirty
(
Dirty
::
LayoutChanged
);
Q_EMIT
canvasIsDirty
(
Dirty
::
Colors
);
}
}
void
SettingsDialog
::
changeContrast
(
int
c
)
{
Config
::
contrast
=
c
;
Q_EMIT
canvasIsDirty
(
Dirty
::
Colors
Changed
);
Q_EMIT
canvasIsDirty
(
Dirty
::
Colors
);
}
void
SettingsDialog
::
toggleUseAntialiasing
(
bool
b
)
{
Config
::
antialias
=
b
;
Q_EMIT
canvasIsDirty
(
Dirty
::
RepaintNeeded
);
Q_EMIT
canvasIsDirty
(
Dirty
::
AntiAliasing
);
}
void
SettingsDialog
::
toggleVaryLabelFontSizes
(
bool
b
)
{
Config
::
varyLabelFontSizes
=
b
;
minFontPitchLabel
->
setEnabled
(
b
);
minFontPitch
->
setEnabled
(
b
);
Q_EMIT
canvasIsDirty
(
Dirty
::
Other
);
Q_EMIT
canvasIsDirty
(
Dirty
::
Font
);
}
void
SettingsDialog
::
changeMinFontPitch
(
int
p
)
{
Config
::
minFontPitch
=
p
;
Q_EMIT
canvasIsDirty
(
Dirty
::
Other
);
Q_EMIT
canvasIsDirty
(
Dirty
::
Font
);
}
void
SettingsDialog
::
toggleShowSmallFiles
(
bool
b
)
{
Config
::
showSmallFiles
=
b
;
Q_EMIT
canvasIsDirty
(
Dirty
::
Layout
Changed
);
Q_EMIT
canvasIsDirty
(
Dirty
::
Layout
);
}
void
SettingsDialog
::
slotSliderReleased
()
{
Q_EMIT
canvasIsDirty
(
Dirty
::
RepaintNeeded
);
}
void
SettingsDialog
::
reject
()
{
//called when escape is pressed
...
...
src/settingsDialog.h
View file @
e671ce9c
...
...
@@ -24,7 +24,7 @@
#include "ui_dialog.h" //generated by uic
#include "
radialMap/radialMap
.h" //
for
Dirty
#include "
Config
.h" // Dirty
#include <QTimer>
#include <QCloseEvent>
...
...
@@ -57,7 +57,6 @@ public Q_SLOTS:
void
changeScheme
(
QAbstractButton
*
button
);
void
changeMinFontPitch
(
int
);
void
toggleShowSmallFiles
(
bool
);
void
slotSliderReleased
();
Q_SIGNALS:
void
mapIsInvalid
();
...
...
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