Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc-2-2
Commits
5c331b20
Commit
5c331b20
authored
Sep 07, 2010
by
Francois Cartegnie
Committed by
Jean-Baptiste Kempf
Sep 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: Only scroll messages if required
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
3e1e07d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+8
-1
No files found.
modules/gui/qt4/dialogs/messages.cpp
View file @
5c331b20
...
...
@@ -40,6 +40,7 @@
#include <QMutex>
#include <QLineEdit>
#include <QPushButton>
#include <QScrollBar>
#include <assert.h>
...
...
@@ -231,6 +232,12 @@ void MessagesDialog::updateConfig()
void
MessagesDialog
::
sinkMessage
(
msg_item_t
*
item
)
{
/* Only scroll if the viewport is at the end.
Don't bug user by auto-changing/loosing viewport on insert(). */
bool
b_autoscroll
=
(
messages
->
verticalScrollBar
()
->
value
()
+
messages
->
verticalScrollBar
()
->
pageStep
()
>=
messages
->
verticalScrollBar
()
->
maximum
()
);
/* Copy selected text to the clipboard */
if
(
messages
->
textCursor
().
hasSelection
()
)
messages
->
copy
();
...
...
@@ -270,7 +277,7 @@ void MessagesDialog::sinkMessage( msg_item_t *item )
messages
->
setTextColor
(
"black"
);
messages
->
insertPlainText
(
qfu
(
item
->
psz_msg
)
);
messages
->
insertPlainText
(
"
\n
"
);
messages
->
ensureCursorVisible
();
if
(
b_autoscroll
)
messages
->
ensureCursorVisible
();
}
void
MessagesDialog
::
customEvent
(
QEvent
*
event
)
...
...
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