Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
97a8dff3
Commit
97a8dff3
authored
Jan 23, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Input Slider simplification... Draging still kind of suck...
parent
011e78e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
62 deletions
+23
-62
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+0
-1
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+1
-1
modules/gui/qt4/util/directslider.hpp
modules/gui/qt4/util/directslider.hpp
+0
-55
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+17
-2
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+5
-3
No files found.
modules/gui/qt4/Modules.am
View file @
97a8dff3
...
...
@@ -146,7 +146,6 @@ noinst_HEADERS = \
components/playlist/playlist.hpp \
components/playlist/selector.hpp \
util/input_slider.hpp \
util/directslider.hpp \
util/customwidgets.hpp \
util/qvlcframe.hpp
...
...
modules/gui/qt4/input_manager.cpp
View file @
97a8dff3
...
...
@@ -476,7 +476,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL),
var_AddCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
/* Warn our embedded IM about input changes */
CONNECT
(
this
,
inputChanged
(
input_thread_t
*
),
im
,
setInput
(
input_thread_t
*
)
);
im
,
setInput
(
input_thread_t
*
)
);
}
MainInputManager
::~
MainInputManager
()
...
...
modules/gui/qt4/util/directslider.hpp
deleted
100644 → 0
View file @
011e78e6
/*****************************************************************************
* directslider.hpp : A slider that goes where you click
****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* with precious help from ahigerd on #qt@freenode
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _DIRECTSLIDER_H_
#define _DIRECTSLIDER_H_
#include <QSlider>
#include <QMouseEvent>
#include <QLayout>
class
DirectSlider
:
public
QSlider
{
public:
DirectSlider
(
QWidget
*
_parent
)
:
QSlider
(
_parent
)
{};
DirectSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
)
:
QSlider
(
q
,
_parent
)
{};
virtual
~
DirectSlider
()
{};
void
mousePressEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
!=
Qt
::
LeftButton
&&
event
->
button
()
!=
Qt
::
MidButton
)
{
QSlider
::
mousePressEvent
(
event
);
return
;
}
QMouseEvent
newEvent
(
event
->
type
(),
event
->
pos
(),
event
->
globalPos
(),
Qt
::
MouseButton
(
event
->
button
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
Qt
::
MouseButtons
(
event
->
buttons
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
event
->
modifiers
()
);
QSlider
::
mousePressEvent
(
&
newEvent
);
}
};
#endif
modules/gui/qt4/util/input_slider.cpp
View file @
97a8dff3
...
...
@@ -29,13 +29,13 @@
#include <QBitmap>
#include <QStyle>
InputSlider
::
InputSlider
(
QWidget
*
_parent
)
:
Direct
Slider
(
_parent
)
InputSlider
::
InputSlider
(
QWidget
*
_parent
)
:
Q
Slider
(
_parent
)
{
InputSlider
::
InputSlider
(
Qt
::
Horizontal
,
_parent
);
}
InputSlider
::
InputSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
)
:
Direct
Slider
(
q
,
_parent
)
Q
Slider
(
q
,
_parent
)
{
mymove
=
false
;
setMinimum
(
0
);
...
...
@@ -68,6 +68,21 @@ void InputSlider::userDrag( int new_value )
}
}
void
InputSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
!=
Qt
::
LeftButton
&&
event
->
button
()
!=
Qt
::
MidButton
)
{
QSlider
::
mousePressEvent
(
event
);
return
;
}
QMouseEvent
newEvent
(
event
->
type
(),
event
->
pos
(),
event
->
globalPos
(),
Qt
::
MouseButton
(
event
->
button
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
Qt
::
MouseButtons
(
event
->
buttons
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
event
->
modifiers
()
);
QSlider
::
mousePressEvent
(
&
newEvent
);
}
void
InputSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
char
psz_length
[
MSTRTIME_MAX_SIZE
];
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
97a8dff3
...
...
@@ -24,9 +24,10 @@
#ifndef _INPUTSLIDER_H_
#define _INPUTSLIDER_H_
#include "util/directslider.hpp"
#include <QSlider>
#include <QMouseEvent>
class
InputSlider
:
public
Direct
Slider
class
InputSlider
:
public
Q
Slider
{
Q_OBJECT
public:
...
...
@@ -34,7 +35,8 @@ public:
InputSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
);
virtual
~
InputSlider
()
{};
protected:
void
mouseMoveEvent
(
QMouseEvent
*
event
);
virtual
void
mouseMoveEvent
(
QMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
private:
bool
mymove
;
int
inputLength
;
...
...
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