Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
691ee09e
Commit
691ee09e
authored
Jan 08, 2019
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
splitter sizes can now be configured and in-app changes are persisted
parent
d6ca0f6e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
8 deletions
+27
-8
OpenBoard.config
resources/etc/OpenBoard.config
+2
-0
UBSettings.cpp
src/core/UBSettings.cpp
+7
-3
UBSettings.h
src/core/UBSettings.h
+4
-0
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+13
-5
UBDocumentController.h
src/document/UBDocumentController.h
+1
-0
No files found.
resources/etc/OpenBoard.config
View file @
691ee09e
...
...
@@ -90,6 +90,8 @@ EmptyGroupNames=@Invalid()
ThumbnailWidth
=
150
SortKind
=
0
SortOrder
=
0
SplitterLeftSize
=
200
SplitterRightSize
=
800
[
IntranetPodcast
]
Author
=
...
...
src/core/UBSettings.cpp
View file @
691ee09e
...
...
@@ -106,6 +106,8 @@ const int UBSettings::maxThumbnailWidth = 400;
const
int
UBSettings
::
defaultThumbnailWidth
=
150
;
const
int
UBSettings
::
defaultSortKind
=
0
;
const
int
UBSettings
::
defaultSortOrder
=
0
;
const
int
UBSettings
::
defaultSplitterLeftSize
=
200
;
const
int
UBSettings
::
defaultSplitterRightSize
=
800
;
const
int
UBSettings
::
defaultLibraryIconSize
=
80
;
...
...
@@ -431,6 +433,8 @@ void UBSettings::init()
documentThumbnailWidth
=
new
UBSetting
(
this
,
"Document"
,
"ThumbnailWidth"
,
UBSettings
::
defaultThumbnailWidth
);
documentSortKind
=
new
UBSetting
(
this
,
"Document"
,
"SortKind"
,
UBSettings
::
defaultSortKind
);
documentSortOrder
=
new
UBSetting
(
this
,
"Document"
,
"SortOrder"
,
UBSettings
::
defaultSortOrder
);
documentSplitterLeftSize
=
new
UBSetting
(
this
,
"Document"
,
"SplitterLeftSize"
,
UBSettings
::
defaultSplitterLeftSize
);
documentSplitterRightSize
=
new
UBSetting
(
this
,
"Document"
,
"SplitterRightSize"
,
UBSettings
::
defaultSplitterRightSize
);
libraryShowDetailsForLocalItems
=
new
UBSetting
(
this
,
"Library"
,
"ShowDetailsForLocalItems"
,
false
);
...
...
src/core/UBSettings.h
View file @
691ee09e
...
...
@@ -217,6 +217,8 @@ class UBSettings : public QObject
static
const
int
defaultThumbnailWidth
;
static
const
int
defaultSortKind
;
static
const
int
defaultSortOrder
;
static
const
int
defaultSplitterLeftSize
;
static
const
int
defaultSplitterRightSize
;
static
const
int
defaultLibraryIconSize
;
static
const
int
defaultImageWidth
;
...
...
@@ -376,6 +378,8 @@ class UBSettings : public QObject
UBSetting
*
documentThumbnailWidth
;
UBSetting
*
documentSortKind
;
UBSetting
*
documentSortOrder
;
UBSetting
*
documentSplitterLeftSize
;
UBSetting
*
documentSplitterRightSize
;
UBSetting
*
imageThumbnailWidth
;
UBSetting
*
videoThumbnailWidth
;
UBSetting
*
shapeThumbnailWidth
;
...
...
src/document/UBDocumentController.cpp
View file @
691ee09e
...
...
@@ -1965,12 +1965,11 @@ void UBDocumentController::setupViews()
mDocumentUI
->
documentTreeView
->
header
()
->
setSectionResizeMode
(
1
,
QHeaderView
::
ResizeToContents
);
mDocumentUI
->
documentTreeView
->
header
()
->
setSectionResizeMode
(
2
,
QHeaderView
::
ResizeToContents
);
//set sizes (left and right sides of the splitter) for the splitter here because it cannot be done in the form editor.
const
int
leftSplitterSize
=
100
;
const
int
rightSplitterSize
=
1200
;
const
int
splitterLeftSize
=
UBSettings
::
settings
()
->
documentSplitterLeftSize
->
get
().
toInt
();
const
int
splitterRightSize
=
UBSettings
::
settings
()
->
documentSplitterRightSize
->
get
().
toInt
();
QList
<
int
>
splitterSizes
;
splitterSizes
.
append
(
leftSplitter
Size
);
splitterSizes
.
append
(
rightSplitter
Size
);
splitterSizes
.
append
(
splitterLeft
Size
);
splitterSizes
.
append
(
splitterRight
Size
);
mDocumentUI
->
splitter
->
setSizes
(
splitterSizes
);
//mDocumentUI->documentTreeView->hideColumn(1);
...
...
@@ -1979,6 +1978,8 @@ void UBDocumentController::setupViews()
connect
(
mDocumentUI
->
sortKind
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
onSortKindChanged
(
int
)));
connect
(
mDocumentUI
->
sortOrder
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
onSortOrderChanged
(
bool
)));
connect
(
mDocumentUI
->
splitter
,
SIGNAL
(
splitterMoved
(
int
,
int
)),
this
,
SLOT
(
onSplitterMoved
(
int
,
int
)));
connect
(
mDocumentUI
->
documentTreeView
->
selectionModel
(),
SIGNAL
(
selectionChanged
(
QItemSelection
,
QItemSelection
)),
this
,
SLOT
(
TreeViewSelectionChanged
(
QItemSelection
,
QItemSelection
)));
connect
(
UBPersistenceManager
::
persistenceManager
()
->
mDocumentTreeStructureModel
,
SIGNAL
(
indexChanged
(
QModelIndex
,
QModelIndex
))
,
mDocumentUI
->
documentTreeView
,
SLOT
(
onModelIndexChanged
(
QModelIndex
,
QModelIndex
)));
...
...
@@ -2051,6 +2052,13 @@ void UBDocumentController::onSortKindChanged(int index)
UBSettings
::
settings
()
->
documentSortKind
->
setInt
(
index
);
}
void
UBDocumentController
::
onSplitterMoved
(
int
size
,
int
index
)
{
Q_UNUSED
(
index
);
UBSettings
::
settings
()
->
documentSplitterLeftSize
->
setInt
(
size
);
UBSettings
::
settings
()
->
documentSplitterRightSize
->
setInt
(
controlView
()
->
size
().
width
()
-
size
);
}
QWidget
*
UBDocumentController
::
controlView
()
{
return
mDocumentWidget
;
...
...
src/document/UBDocumentController.h
View file @
691ee09e
...
...
@@ -460,6 +460,7 @@ class UBDocumentController : public UBDocumentContainer
//N/C - NNE - 20140403
void
onSortKindChanged
(
int
index
);
void
onSortOrderChanged
(
bool
order
);
void
onSplitterMoved
(
int
size
,
int
index
);
void
collapseAll
();
void
expandAll
();
...
...
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