Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F630367
FileDiffSliderWidget.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
FileDiffSliderWidget.h
View Options
#ifndef FILEDIFFSLIDERWIDGET_H
#define FILEDIFFSLIDERWIDGET_H
#include
"MainWindow.h"
#include
<QWidget>
#include
<QPixmap>
#include
<functional>
#include
"AbstractCharacterBasedApplication.h"
#include
"Theme.h"
using
TextDiffLine
=
Document
::
Line
;
using
TextDiffLineList
=
QList
<
Document
::
Line
>
;
enum
class
DiffPane
{
Left
,
Right
,
};
typedef
std
::
function
<
QPixmap
(
DiffPane
pane
,
int
width
,
int
height
)
>
fn_pixmap_maker_t
;
class
FileDiffSliderWidget
:
public
QWidget
{
Q_OBJECT
private
:
struct
Private
;
Private
*
m
;
void
scroll_
(
int
pos
);
QPixmap
makeDiffPixmap
(
DiffPane
pane
,
int
width
,
int
height
);
void
setValue
(
int
v
);
void
internalSetValue
(
int
v
);
public
:
explicit
FileDiffSliderWidget
(
QWidget
*
parent
=
nullptr
);
~
FileDiffSliderWidget
()
override
;
void
clear
(
bool
v
);
void
setScrollPos
(
int
total
,
int
value
,
int
size
);
void
init
(
fn_pixmap_maker_t
pixmap_maker
,
ThemePtr
theme
);
void
updatePixmap
();
static
QPixmap
makeDiffPixmap
(
int
width
,
int
height
,
TextDiffLineList
const
&
lines
,
ThemePtr
theme
);
protected
:
void
paintEvent
(
QPaintEvent
*
)
override
;
void
resizeEvent
(
QResizeEvent
*
)
override
;
void
mousePressEvent
(
QMouseEvent
*
)
override
;
void
mouseMoveEvent
(
QMouseEvent
*
)
override
;
void
wheelEvent
(
QWheelEvent
*
event
)
override
;
signals
:
void
valueChanged
(
int
value
);
void
scrollByWheel
(
int
lines
);
};
#endif
// FILEDIFFSLIDERWIDGET_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Nov 15, 9:19 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
143175
Default Alt Text
FileDiffSliderWidget.h (1 KB)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline