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
1423fb93
Commit
1423fb93
authored
Jun 10, 2013
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
centered left panel on selected thumbnail
parent
8148ac76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+6
-0
UBDocumentNavigator.h
src/gui/UBDocumentNavigator.h
+4
-2
No files found.
src/gui/UBDocumentNavigator.cpp
View file @
1423fb93
...
@@ -52,6 +52,7 @@ UBDocumentNavigator::UBDocumentNavigator(QWidget *parent, const char *name):QGra
...
@@ -52,6 +52,7 @@ UBDocumentNavigator::UBDocumentNavigator(QWidget *parent, const char *name):QGra
,
mNbColumns
(
1
)
,
mNbColumns
(
1
)
,
mThumbnailWidth
(
0
)
,
mThumbnailWidth
(
0
)
,
mThumbnailMinWidth
(
100
)
,
mThumbnailMinWidth
(
100
)
,
mSelectedThumbnail
(
NULL
)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
mScene
=
new
QGraphicsScene
(
this
);
mScene
=
new
QGraphicsScene
(
this
);
...
@@ -123,6 +124,7 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
...
@@ -123,6 +124,7 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
if
(
c
==
index
)
if
(
c
==
index
)
{
{
el
.
getThumbnail
()
->
setSelected
(
true
);
el
.
getThumbnail
()
->
setSelected
(
true
);
mSelectedThumbnail
=
el
.
getThumbnail
();
}
}
else
else
{
{
...
@@ -130,6 +132,7 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
...
@@ -130,6 +132,7 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
}
}
c
++
;
c
++
;
}
}
centerOn
(
mSelectedThumbnail
);
}
}
/**
/**
...
@@ -228,6 +231,9 @@ void UBDocumentNavigator::resizeEvent(QResizeEvent *event)
...
@@ -228,6 +231,9 @@ void UBDocumentNavigator::resizeEvent(QResizeEvent *event)
// Update the thumbnails width
// Update the thumbnails width
mThumbnailWidth
=
(
width
()
>
mThumbnailMinWidth
)
?
width
()
-
2
*
border
()
:
mThumbnailMinWidth
;
mThumbnailWidth
=
(
width
()
>
mThumbnailMinWidth
)
?
width
()
-
2
*
border
()
:
mThumbnailMinWidth
;
if
(
mSelectedThumbnail
)
centerOn
(
mSelectedThumbnail
);
// Refresh the scene
// Refresh the scene
refreshScene
();
refreshScene
();
}
}
...
...
src/gui/UBDocumentNavigator.h
View file @
1423fb93
...
@@ -76,6 +76,8 @@ private:
...
@@ -76,6 +76,8 @@ private:
int
mThumbnailWidth
;
int
mThumbnailWidth
;
/** The current thumbnails minimum width */
/** The current thumbnails minimum width */
int
mThumbnailMinWidth
;
int
mThumbnailMinWidth
;
/** The selected thumbnail */
UBSceneThumbnailNavigPixmap
*
mSelectedThumbnail
;
};
};
#endif // UBDOCUMENTNAVIGATOR_H
#endif // UBDOCUMENTNAVIGATOR_H
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