File indexing completed on 2025-02-02 04:11:35
0001 /* 0002 * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #include "fill_tool_widget.hpp" 0008 #include "ui_fill_tool_widget.h" 0009 #include <QEvent> 0010 0011 using namespace glaxnimate::gui; 0012 using namespace glaxnimate; 0013 0014 class FillToolWidget::Private 0015 { 0016 public: 0017 Ui::FillToolWidget ui; 0018 }; 0019 0020 FillToolWidget::FillToolWidget(QWidget* parent) 0021 : QWidget(parent), d(std::make_unique<Private>()) 0022 { 0023 d->ui.setupUi(this); 0024 } 0025 0026 FillToolWidget::~FillToolWidget() = default; 0027 0028 void FillToolWidget::changeEvent ( QEvent* e ) 0029 { 0030 QWidget::changeEvent(e); 0031 0032 if ( e->type() == QEvent::LanguageChange) 0033 { 0034 d->ui.retranslateUi(this); 0035 } 0036 } 0037 0038 bool FillToolWidget::fill() const 0039 { 0040 return !d->ui.check_stroke->isChecked(); 0041 } 0042 0043 bool FillToolWidget::stroke() const 0044 { 0045 return !d->ui.check_fill->isChecked(); 0046 } 0047 0048 void FillToolWidget::swap_fill_color() 0049 { 0050 if ( d->ui.check_stroke->isChecked() ) 0051 d->ui.check_fill->setChecked(true); 0052 else if ( d->ui.check_fill->isChecked() ) 0053 d->ui.check_stroke->setChecked(true); 0054 } 0055 0056 0057