forked from pencil2d/pencil
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-implement cell drag gutter as a widget
- Loading branch information
Showing
10 changed files
with
80 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "timelinelayercellgutterwidget.h" | ||
|
||
#include <QPainter> | ||
#include <QApplication> | ||
|
||
TimeLineLayerCellGutterWidget::TimeLineLayerCellGutterWidget(int width, QWidget* parent) | ||
: QWidget(parent) | ||
{ | ||
|
||
setGeometry(0, 0, width, 2); | ||
} | ||
|
||
void TimeLineLayerCellGutterWidget::paintEvent(QPaintEvent* event) | ||
{ | ||
QPainter painter(this); | ||
QPalette palette = QApplication::palette(); | ||
|
||
painter.setPen(palette.color(QPalette::HighlightedText)); | ||
painter.drawRect(0, rect().bottom(), rect().width(), 2); | ||
} | ||
|
||
void TimeLineLayerCellGutterWidget::updateWidth(int width) | ||
{ | ||
resize(width, height()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef TIMELINELAYERCELLGUTTERWIDGET_H | ||
#define TIMELINELAYERCELLGUTTERWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
class TimeLineLayerCellGutterWidget : public QWidget | ||
{ | ||
public: | ||
TimeLineLayerCellGutterWidget(int width, QWidget* parent = nullptr); | ||
|
||
void paintEvent(QPaintEvent* event) override; | ||
void updateWidth(int width); | ||
}; | ||
|
||
#endif // TIMELINELAYERCELLGUTTERWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters