Skip to content

Commit

Permalink
Move misc to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Mar 15, 2024
1 parent e698c1d commit 9bc3b63
Show file tree
Hide file tree
Showing 17 changed files with 170 additions and 51 deletions.
8 changes: 0 additions & 8 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,12 @@ set(
GUI/Settings/pluginssettingswidget.cpp
GUI/Settings/presetsettingswidget.cpp
GUI/aboutwidget.cpp
GUI/bookmarkedwidget.cpp
GUI/buttonslist.cpp
GUI/canvasbasewrappernode.cpp
GUI/canvaswindowevents.cpp
GUI/canvaswrappernode.cpp
GUI/changewidthwidget.cpp
#GUI/closesignalingdockwidget.cpp
GUI/ekeyfilter.cpp
GUI/ewidgetsimpl.cpp
GUI/fakemenubar.cpp
GUI/layouthandler.cpp
GUI/scenechooser.cpp
GUI/timelinebasewrappernode.cpp
Expand Down Expand Up @@ -295,15 +291,11 @@ set(
GUI/Settings/pluginssettingswidget.h
GUI/Settings/presetsettingswidget.h
GUI/aboutwidget.h
GUI/bookmarkedwidget.h
GUI/buttonslist.h
GUI/canvasbasewrappernode.h
GUI/canvaswrappernode.h
GUI/changewidthwidget.h
#GUI/closesignalingdockwidget.h
GUI/ekeyfilter.h
GUI/ewidgetsimpl.h
GUI/fakemenubar.h
GUI/layouthandler.h
GUI/scenechooser.h
GUI/timelinebasewrappernode.h
Expand Down
25 changes: 25 additions & 0 deletions src/app/GUI/ColorWidgets/bookmarkedcolors.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# See 'README.md' for more information.
#
*/

// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner

#include "bookmarkedcolors.h"
#include "savedcolorbutton.h"
#include "Private/document.h"
Expand Down
31 changes: 29 additions & 2 deletions src/app/GUI/ColorWidgets/bookmarkedcolors.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
/*
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# See 'README.md' for more information.
#
*/

// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner

#ifndef BOOKMARKEDCOLORS_H
#define BOOKMARKEDCOLORS_H
#include "../bookmarkedwidget.h"

class BookmarkedColors : public BookmarkedWidget {
#include "widgets/bookmarkedwidget.h"

class BookmarkedColors : public BookmarkedWidget
{
Q_OBJECT
public:
BookmarkedColors(const bool vertical,
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/Dialogs/dialogsinterfaceimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <QLabel>
#include <QStatusBar>

#include "../buttonslist.h"
#include "widgets/buttonslist.h"
#include "GUI/global.h"
#include "GUI/mainwindow.h"
#include "GUI/Expressions/expressiondialog.h"
Expand Down
33 changes: 0 additions & 33 deletions src/app/GUI/bookmarkedwidget.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/GUI/timelinewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "GUI/global.h"
#include "canvas.h"
#include "scenechooser.h"
#include "changewidthwidget.h"
#include "widgets/changewidthwidget.h"
#include "timelinehighlightwidget.h"

TimelineWidget::TimelineWidget(Document &document,
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/timelinewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "smartPointers/stdselfref.h"
#include "framerange.h"
#include "ReadWrite/basicreadwrite.h"
#include "fakemenubar.h"
#include "widgets/fakemenubar.h"
#include "XML/runtimewriteid.h"

class SWT_Abstraction;
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/widgetwrappernode.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <QMenuBar>
#include "Private/esettings.h"
#include "wrappernode.h"
#include "fakemenubar.h"
#include "widgets/fakemenubar.h"

class StackWrapperMenu : public FakeMenuBar {
friend class StackWidgetWrapper;
Expand Down
10 changes: 9 additions & 1 deletion src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ set(
widgets/actionbutton.cpp
widgets/alignwidget.cpp
widgets/assetswidget.cpp
widgets/bookmarkedwidget.cpp
widgets/buttonbase.cpp
widgets/buttonslist.cpp
widgets/changewidthwidget.cpp
widgets/ecombobox.cpp
widgets/editablecombobox.cpp
widgets/fakemenubar.cpp
widgets/flowlayout.cpp
widgets/buttonbase.cpp
widgets/twocolumnlayout.cpp
widgets/uilayout.cpp
)
Expand All @@ -53,9 +57,13 @@ set(
widgets/actionbutton.h
widgets/alignwidget.h
widgets/assetswidget.h
widgets/bookmarkedwidget.h
widgets/buttonbase.h
widgets/buttonslist.h
widgets/changewidthwidget.h
widgets/ecombobox.h
widgets/editablecombobox.h
widgets/fakemenubar.h
widgets/flowlayout.h
widgets/toolbutton.h
widgets/twocolumnlayout.h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# See 'README.md' for more information.
#
*/

// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner

#include "bookmarkedwidget.h"
#include "Private/esettings.h"
#include "GUI/global.h"
Expand Down
63 changes: 63 additions & 0 deletions src/ui/widgets/bookmarkedwidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# See 'README.md' for more information.
#
*/

// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner

#ifndef BOOKMARKEDWIDGET_H
#define BOOKMARKEDWIDGET_H

#include "ui_global.h"

#include <QWidget>
#include <QPushButton>

class UI_EXPORT BookmarkedWidget : public QWidget
{
public:
explicit BookmarkedWidget(const bool vertical,
const int dimension,
QWidget *parent = nullptr);

void addWidget(QWidget* const wid);
void removeWidget(QWidget* const wid);
QWidget* getWidget(const int id) const;
int count() const
{ return mWidgets.count(); }
void updateSize();

protected:
void resizeEvent(QResizeEvent *event);

private:
void updateLayout();

const bool mVertical;
const int mDimension;
QPushButton* mUpArrow;
QPushButton* mDownArrow;
QList<QWidget*> mWidgets;
int mFirstViewed = 0;
int mLastViewed = 0;
};

#endif // BOOKMARKEDWIDGET_H
File renamed without changes.
5 changes: 4 additions & 1 deletion src/app/GUI/buttonslist.h → src/ui/widgets/buttonslist.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@
#ifndef BUTTONSLIST_H
#define BUTTONSLIST_H

#include "ui_global.h"

#include <QWidget>
#include <functional>

class ButtonsList : public QWidget {
class UI_EXPORT ButtonsList : public QWidget
{
public:
using Trigger = std::function<void()>;
using TextTrigger = std::pair<QString, Trigger>;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@

#ifndef CHANGEWIDTHWIDGET_H
#define CHANGEWIDTHWIDGET_H

#include "ui_global.h"

#include <QWidget>

class ChangeWidthWidget : public QWidget {
class UI_EXPORT ChangeWidthWidget : public QWidget
{
Q_OBJECT

public:
ChangeWidthWidget(QWidget *parent = nullptr);

Expand All @@ -49,6 +54,7 @@ class ChangeWidthWidget : public QWidget {

signals:
void widthSet(int);

private:
bool mHover = false;
bool mPressed = false;
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion src/app/GUI/fakemenubar.h → src/ui/widgets/fakemenubar.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
#ifndef FAKEMENUBAR_H
#define FAKEMENUBAR_H

#include "ui_global.h"

#include <QHBoxLayout>
#include <QMenu>

class FakeMenuBar : public QWidget {
class UI_EXPORT FakeMenuBar : public QWidget
{
public:
explicit FakeMenuBar(QWidget* const parent = nullptr);

Expand Down

0 comments on commit 9bc3b63

Please sign in to comment.