Skip to content

Commit

Permalink
Theme UX
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 22, 2024
1 parent 9a67088 commit 678bebc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/GUI/BoxesList/boxscroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void BoxScroller::paintEvent(QPaintEvent *) {

TimelineHighlightWidget *BoxScroller::requestHighlighter() {
if(!mHighlighter) {
mHighlighter = new TimelineHighlightWidget(false, this, true);
mHighlighter = new TimelineHighlightWidget(true, this, true);
mHighlighter->resize(size());
}
return mHighlighter;
Expand Down
16 changes: 15 additions & 1 deletion src/app/GUI/BoxesList/boxsinglewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,18 @@ void BoxSingleWidget::mouseReleaseEvent(QMouseEvent *event) {
}
}

void BoxSingleWidget::enterEvent(QEvent *)
{
mHover = true;
update();
}

void BoxSingleWidget::leaveEvent(QEvent *)
{
mHover = false;
update();
}

void BoxSingleWidget::mouseDoubleClickEvent(QMouseEvent *e)
{
Q_UNUSED(e)
Expand Down Expand Up @@ -767,6 +779,8 @@ void BoxSingleWidget::paintEvent(QPaintEvent *) {

int nameX = mFillWidget->x();

if (mHover) { p.fillRect(rect(), ThemeSupport::getThemeHighlightColor(40)); }

const auto bsTarget = enve_cast<eBoxOrSound*>(prop);
if (!bsTarget && prop->prp_isSelected()) {
p.fillRect(mFillWidget->geometry(),
Expand All @@ -779,7 +793,7 @@ void BoxSingleWidget::paintEvent(QPaintEvent *) {
p.fillRect(rect(), QColor(0, 0, 0, 50));
if (bsTarget->isSelected()) {
p.fillRect(mFillWidget->geometry(),
ThemeSupport::getThemeButtonBaseColor());
ThemeSupport::getThemeHighlightSelectedColor(50));
p.setPen(Qt::white);
} else {
p.setPen(Qt::white);
Expand Down
5 changes: 5 additions & 0 deletions src/app/GUI/BoxesList/boxsinglewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class BoxSingleWidget : public SingleWidget {
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);

void enterEvent(QEvent *);
void leaveEvent(QEvent *);

void paintEvent(QPaintEvent *);
void mouseDoubleClickEvent(QMouseEvent *e);
void resizeEvent(QResizeEvent *);
Expand Down Expand Up @@ -136,6 +139,8 @@ class BoxSingleWidget : public SingleWidget {
bool mDragPressPos = false;
QPoint mDragStartPos;

bool mHover = false;

PixmapActionButton *mRecordButton;
PixmapActionButton *mContentButton;
PixmapActionButton *mVisibleButton;
Expand Down

0 comments on commit 678bebc

Please sign in to comment.