Skip to content

Commit

Permalink
Merge pull request #145 from friction2d/dev
Browse files Browse the repository at this point in the history
Icon fixes
  • Loading branch information
rodlie authored May 12, 2024
2 parents ab60cfa + 8ef6498 commit 68145e7
Show file tree
Hide file tree
Showing 253 changed files with 2,133 additions and 423 deletions.
2 changes: 0 additions & 2 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ set(
effectsloader.cpp
eimporters.cpp
evfileio.cpp
iconloader.cpp
renderhandler.cpp
GUI/BoxesList/boxsinglewidget.cpp
GUI/BoxesList/boxscrollwidget.cpp
Expand Down Expand Up @@ -228,7 +227,6 @@ set(
GUI/ColorWidgets/colorpickingwidget.h
effectsloader.h
eimporters.h
iconloader.h
renderhandler.h
GUI/BoxesList/boxsinglewidget.h
GUI/BoxesList/boxscrollwidget.h
Expand Down
307 changes: 161 additions & 146 deletions src/app/GUI/BoxesList/boxsinglewidget.cpp

Large diffs are not rendered by default.

51 changes: 25 additions & 26 deletions src/app/GUI/BoxesList/boxsinglewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#ifndef BOXSINGLEWIDGET_H
#define BOXSINGLEWIDGET_H

#include "GUI/boxeslistactionbutton.h"
#include "optimalscrollarena/singlewidget.h"
#include <QLabel>
#include <QHBoxLayout>
Expand All @@ -40,8 +41,6 @@ class QrealAnimatorValueSlider;
class TimelineMovable;
class Key;
class BoxTargetWidget;
class BoxesListActionButton;
class PixmapActionButton;
class BoolPropertyWidget;
class ComboBoxProperty;
class ColorAnimator;
Expand All @@ -55,24 +54,24 @@ class BoxSingleWidget : public SingleWidget {

void setTargetAbstraction(SWT_Abstraction *abs);

static QPixmap* VISIBLE_PIXMAP;
static QPixmap* INVISIBLE_PIXMAP;
static QPixmap* BOX_CHILDREN_VISIBLE;
static QPixmap* BOX_CHILDREN_HIDDEN;
static QPixmap* ANIMATOR_CHILDREN_VISIBLE;
static QPixmap* ANIMATOR_CHILDREN_HIDDEN;
static QPixmap* LOCKED_PIXMAP;
static QPixmap* UNLOCKED_PIXMAP;
static QPixmap* MUTED_PIXMAP;
static QPixmap* UNMUTED_PIXMAP;
static QPixmap* ANIMATOR_RECORDING;
static QPixmap* ANIMATOR_NOT_RECORDING;
static QPixmap* ANIMATOR_DESCENDANT_RECORDING;
static QPixmap* C_PIXMAP;
static QPixmap* G_PIXMAP;
static QPixmap* CG_PIXMAP;
static QPixmap* GRAPH_PROPERTY;
static QPixmap* PROMOTE_TO_LAYER_PIXMAP;
static QIcon* VISIBLE_ICON;
static QIcon* INVISIBLE_ICON;
static QIcon* BOX_CHILDREN_VISIBLE_ICON;
static QIcon* BOX_CHILDREN_HIDDEN_ICON;
static QIcon* ANIMATOR_CHILDREN_VISIBLE_ICON;
static QIcon* ANIMATOR_CHILDREN_HIDDEN_ICON;
static QIcon* LOCKED_ICON;
static QIcon* UNLOCKED_ICON;
static QIcon* MUTED_ICON;
static QIcon* UNMUTED_ICON;
static QIcon* ANIMATOR_RECORDING_ICON;
static QIcon* ANIMATOR_NOT_RECORDING_ICON;
static QIcon* ANIMATOR_DESCENDANT_RECORDING_ICON;
static QIcon* C_ICON;
static QIcon* G_ICON;
static QIcon* CG_ICON;
static QIcon* GRAPH_PROPERTY_ICON;
static QIcon* PROMOTE_TO_LAYER_ICON;

static bool sStaticPixmapsLoaded;
static void loadStaticPixmaps();
Expand Down Expand Up @@ -137,11 +136,11 @@ class BoxSingleWidget : public SingleWidget {
bool mDragPressPos = false;
QPoint mDragStartPos;

PixmapActionButton *mRecordButton;
PixmapActionButton *mContentButton;
PixmapActionButton *mVisibleButton;
PixmapActionButton *mLockedButton;
PixmapActionButton *mHwSupportButton;
IconActionButton *mRecordButton;
IconActionButton *mContentButton;
IconActionButton *mVisibleButton;
IconActionButton *mLockedButton;
IconActionButton *mHwSupportButton;
ColorAnimatorButton *mColorButton;
BoxTargetWidget *mBoxTargetWidget;

Expand All @@ -151,7 +150,7 @@ class BoxSingleWidget : public SingleWidget {
QrealAnimatorValueSlider *mValueSlider;
QrealAnimatorValueSlider *mSecondValueSlider;

PixmapActionButton *mPromoteToLayerButton;
IconActionButton *mPromoteToLayerButton;
eComboBox *mPropertyComboBox;
eComboBox *mBlendModeCombo;
eComboBox *mPathBlendModeCombo;
Expand Down
40 changes: 19 additions & 21 deletions src/app/GUI/fillstrokesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,17 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document,
connect(&mDocument, &Document::selectedPaintSettingsChanged,
this, &FillStrokeSettingsWidget::updateCurrentSettings);

const auto iconsDir = eSettings::sIconsDir(); // remove when new icons have been added

// main buttons
mFillTargetButton = new QPushButton(QIcon(iconsDir + "/properties_fill.png"),
tr("Fill"), this);
mStrokeTargetButton = new QPushButton(QIcon(iconsDir + "/properties_stroke_paint.png"),
tr("Stroke"), this);
mFillNoneButton = new QPushButton(QIcon(iconsDir + "/fill_none.png"),
mFillTargetButton = new QPushButton(QIcon(":/icons/noInterpolation/properties_fill.png"),
tr("Fill"), this); // TODO: svg
mStrokeTargetButton = new QPushButton(QIcon(":/icons/noInterpolation/properties_stroke_paint.png"),
tr("Stroke"), this); // TODO svg
mFillNoneButton = new QPushButton(QIcon::fromTheme("fill_none").pixmap(10, 10),
tr("None"), this);
mFillFlatButton = new QPushButton(QIcon(iconsDir + "/fill_flat.png"),
tr("Flat"), this);
mFillGradientButton = new QPushButton(QIcon(iconsDir + "/fill_gradient.png"),
tr("Gradient"), this);
mFillFlatButton = new QPushButton(QIcon(":/icons/noInterpolation/fill_flat.png"),
tr("Flat"), this); // TODO: svg
mFillGradientButton = new QPushButton(QIcon(":/icons/noInterpolation/fill_gradient.png"),
tr("Gradient"), this); // TODO: svg

mFillTargetButton->setCheckable(true);
mFillNoneButton->setCheckable(true);
Expand Down Expand Up @@ -155,11 +153,11 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document,
mJoinStyleWidget->setContentsMargins(0, 0, 0, 0);
mJoinStyleLayout->setMargin(0);

mBevelJoinStyleButton = new QPushButton(QIcon(iconsDir + "/joinBevel.png"),
mBevelJoinStyleButton = new QPushButton(QIcon::fromTheme("joinBevel"),
QString(), this);
mMiterJointStyleButton = new QPushButton(QIcon(iconsDir + "/joinMiter.png"),
mMiterJointStyleButton = new QPushButton(QIcon::fromTheme("joinMiter"),
QString(), this);
mRoundJoinStyleButton = new QPushButton(QIcon(iconsDir + "/joinRound.png"),
mRoundJoinStyleButton = new QPushButton(QIcon::fromTheme("joinRound"),
QString(), this);

mBevelJoinStyleButton->setToolTip(tr("Bevel"));
Expand Down Expand Up @@ -194,11 +192,11 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document,
mCapStyleWidget->setContentsMargins(0, 0, 0, 0);
mCapStyleLayout->setMargin(0);

mFlatCapStyleButton = new QPushButton(QIcon(iconsDir + "/capFlat.png"),
mFlatCapStyleButton = new QPushButton(QIcon::fromTheme("capFlat"),
QString(), this);
mSquareCapStyleButton = new QPushButton(QIcon(iconsDir + "/capSquare.png"),
mSquareCapStyleButton = new QPushButton(QIcon::fromTheme("capSquare"),
QString(), this);
mRoundCapStyleButton = new QPushButton(QIcon(iconsDir + "/capRound.png"),
mRoundCapStyleButton = new QPushButton(QIcon::fromTheme("capRound"),
QString(), this);

mFlatCapStyleButton->setToolTip(tr("Flat"));
Expand Down Expand Up @@ -236,10 +234,10 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document,
mGradientTypeWidget->setContentsMargins(0, 0, 0, 0);
mGradientTypeLayout->setMargin(0);

mLinearGradientButton = new QPushButton(QIcon(iconsDir + "/fill_gradient.png"),
tr("Linear"), this);
mRadialGradientButton = new QPushButton(QIcon(iconsDir + "/fill_gradient_radial.png"),
tr("Radial"), this);
mLinearGradientButton = new QPushButton(QIcon(":/icons/noInterpolation/fill_gradient.png"),
tr("Linear"), this); // TODO svg
mRadialGradientButton = new QPushButton(QIcon(":/icons/noInterpolation/fill_gradient_radial.png"),
tr("Radial"), this); // TODO svg

mLinearGradientButton->setCheckable(true);
mRadialGradientButton->setCheckable(true);
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ MainWindow::MainWindow(Document& document,
stylesheet.close();
}

BoxSingleWidget::loadStaticPixmaps(); // TODO: remove when everything is QIcon
BoxSingleWidget::loadStaticPixmaps();

mDocument.setPath("");

Expand Down
Loading

0 comments on commit 68145e7

Please sign in to comment.