--User changes

-Add new style sheet called uranium that is reminiscent of the old Winamp color scheme of the same name.
 -All for keyboard presses to edit affines.
 --Q: rotate counter clockwise.
 --E: rotate clockwise.
 --W: move up.
 --S: move down.
 --A: move left.
 --D: move right.
 --G: shrink.
 --H: grow.
 --Hold shift to decrease amount, control to increase amount.
 -Change some menu shortcuts to accommodate these new affine editing shortcuts.
 -Random xaos now just provides values of either 0 or 1. Hold control to get the old behavior.

--Bug fixes
 -Waffle variation was broken in OpenCL.
This commit is contained in:
Person 2020-01-14 20:08:27 -08:00
parent 75ffc2f665
commit ed35622928
13 changed files with 1067 additions and 42 deletions

View File

@ -268,7 +268,11 @@
<Component Id="lightdark.qss" Guid="e4cbb38c-359e-464d-938b-e52ff0ce375d">
<File Id="lightdark.qss" Source="$(var.SolutionDir)..\..\..\Data\lightdark.qss" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component>
<Component Id="uranium.qss" Guid="64e23769-0631-4c5c-a714-bf7c50dc3c1a">
<File Id="uranium.qss" Source="$(var.SolutionDir)..\..\..\Data\uranium.qss" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component>
<Component Id="VersionHistory.txt" Guid="8b031217-9e7d-4700-9ab8-2593a4e002b6">
<File Id="VersionHistory.txt" Source="$(var.SolutionDir)..\..\..\Data\Version History.txt" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component>

View File

@ -99,6 +99,7 @@ themes.files = $$ASSETS_DIR/dark_linux.qss
}
themes.files += $$ASSETS_DIR/lightdark.qss
themes.files += $$ASSETS_DIR/uranium.qss
#message(THEMES INSTALL SOURCE: $$themes.files)
INSTALLS += themes

851
Data/uranium.qss Normal file
View File

@ -0,0 +1,851 @@
*
{
font: 8.5pt "MS Shell Dlg 2";/*For some reason the font changes if you set any style. Set this to whatever font is the default on your system*/
}
QObject
{
background-color: #706F77;
color: rgb(124, 232, 0);
alternate-background-color: #706F77;
selection-color: rgb(124, 232, 0);
}
QObject:disabled
{
color: rgba(255, 255, 255, 40);
}
QStatusBar
{
background-color: rgb(115, 133, 116);
}
/*This is needed to give the labels on the status bar some padding.*/
QStatusBar QLabel { padding-left: 2px; padding-right: 2px; }
Fractorium
{
qproperty-VariationTreeColorNonZero: rgb(221, 255, 130);
qproperty-VariationTreeColorZero: rgb(124, 232, 0);
qproperty-VariationTreeBgColorNonZero: rgb(35, 36, 34);
qproperty-VariationTreeBgColorZero:#706F77;
}
/*==================================================================================================
QTableView
==================================================================================================*/
/*For some reason, Qt does not draw table headers correctly, so the style must always be manually specified.*/
QHeaderView::section::vertical:enabled
{
width: 12px;
color: black;
background-color: rgb(176, 204, 177);
border: none;
padding: 0px;
padding-left: 4px;
}
QHeaderView::section::horizontal:enabled
{
height: 18px;
color: black;
background-color: rgb(176, 204, 177);
border: none;
padding: 0px;
padding-left: 4px;
}
QHeaderView::section::vertical:disabled
{
width: 12px;
color: rgb(35, 35, 35);
background-color: rgb(53, 53, 53);
border: none;
padding: 0px;
padding-left: 4px;
}
QHeaderView::section::horizontal:disabled
{
height: 18px;
color:rgb(35, 35, 35);
background-color: rgb(53, 53, 53);
border: none;
padding: 0px;
padding-left: 4px;
}
QTableView
{
border: 1px solid rgb(176, 204, 177);
gridline-color: rgb(176, 204, 177);
selection-background-color: rgb(115, 133, 116);
}
QTableView QTableCornerButton::section:enabled
{
border: none;
background-color: rgb(176, 204, 177);
}
QTableView QTableCornerButton::section:disabled
{
border: none;
background-color: rgb(53, 53, 53);
}
QTableView::indicator:disabled
{
background-color: rgb(53, 53, 53);
}
QTableView:disabled
{
color: rgb(35, 35, 35);
border: 1px solid rgb(53, 53, 53);
gridline-color: rgb(35, 35, 35);
}
QTableWidget
{
border: 1px solid rgb(176, 204, 177);
selection-background-color: rgb(115, 133, 116);
}
QTableWidget::item:hover
{
border: 0px none black;
color: rgb(221, 255, 130);
background-color: rgb(115, 133, 116);
outline: none;
}
QTableWidget::item:selected
{
border: 0px none black;
color: rgb(221, 255, 130);
background-color: rgb(35, 36, 34);
outline: none;
}
/*==================================================================================================
QScrollBar
==================================================================================================*/
QScrollBar::vertical
{
background-color: rgb(115, 133, 116);
border: 0px solid rgb(115, 133, 116);
width: 15px;
margin: 22px 0 22px 0;
}
QScrollBar::handle::vertical
{
background-color: rgb(176, 204, 177);
border-top: 1px solid rgb(115, 133, 116);
border-bottom: 1px solid rgb(115, 133, 116);
min-height: 20px;
}
QScrollBar::add-line::vertical
{
border: 0px solid darkgray;
background-color: gray;
height: 22px;
subcontrol-position: bottom;
subcontrol-origin: margin;
}
QScrollBar::sub-line::vertical
{
border: 0px solid darkgray;
background-color: gray;
height: 22px;
subcontrol-position: top;
subcontrol-origin: margin;
}
QScrollBar::up-arrow::vertical, QScrollBar::down-arrow::vertical
{
border: 2px solid rgb(124, 232, 0);
width: 5px;
height: 12px;
background-color: gray;
}
QScrollBar::add-page::vertical,
QScrollBar::sub-page::vertical,
QScrollBar::add-page::horizontal,
QScrollBar::sub-page::horizontal
{
background-color: rgb(115, 133, 116);
}
QScrollBar::horizontal
{
background-color: rgb(176, 204, 177);
border: 0px solid darkgray;
height: 15px;
margin: 0px 20px 0 20px;
}
QScrollBar::handle::horizontal
{
background-color: rgb(176, 204, 177);
border-left: 1px solid rgb(115, 133, 116);
border-right: 1px solid rgb(115, 133, 116);
min-width: 20px;
}
QScrollBar::add-line::horizontal
{
border: 0px solid darkgray;
background-color: gray;
width: 20px;
subcontrol-position: right;
subcontrol-origin: margin;
}
QScrollBar::sub-line::horizontal
{
border: 0px solid darkgray;
background-color: gray;
width: 20px;
subcontrol-position: left;
subcontrol-origin: margin;
}
QScrollBar::left-arrow::horizontal,
QScrollBar::right-arrow::horizontal
{
border: 2px solid rgb(124, 232, 0);
width: 12px;
height: 5px;
background-color: gray;
}
/*==================================================================================================
QMenu
==================================================================================================*/
QMenuBar
{
background-color: rgb(115, 133, 116);
}
QMenuBar::item
{
padding: 4px;
background-color: rgb(115, 133, 116);
}
QMenuBar::item:selected
{
background-color: rgb(176, 204, 177);
color: black;
}
QMenu
{
border: none;
margin: 0;
menu-scrollable: 0;
}
QMenu::icon
{
margin: 5px;
}
QMenu::item
{
padding: 5px 30px 5px 30px;
}
QMenu::item:enabled:selected
{
background-color: rgb(176, 204, 177);
color: black;
}
QMenu::item:disabled
{
color: #A0A0A0;
}
QMenu::separator
{
height: 1px;
background-color: #A9A9A9;
margin: 0;
}
/*==================================================================================================
Dock widget
==================================================================================================*/
QDockWidget::title
{
text-align: center;
background-color: rgb(115, 133, 116);
border: 2px solid #706F77; /* fix to simulate margin between this :title and tabs */ /* same as main background color */
border-radius: 6px; /* bigger than normal due to previous border fix */
padding: 4px 0px; /* also needed because of previous border fix */
}
QDockWidget::float-button
{
background-color: rgb(176, 204, 177);
border-radius: 3px;
subcontrol-origin: padding;
subcontrol-position: right center;
}
QDockWidget::float-button
{
right: 4px;
}
QDockWidget::float-button:hover
{
background-color: rgb(176, 204, 177);
border: 2px solid #706F77;
}
QDockWidget::float-button:pressed
{
background-color: rgba(176, 204, 177,30);
border: 2px solid #706F77;
}
/*==================================================================================================
QTabWidget
==================================================================================================*/
QTabWidget::pane
{
background-color: transparent;
position: absolute;
}
QTabWidget::pane:top
{
top: -1px;
border-top: 1px solid #4a4a4a;
}
QTabWidget::pane:bottom
{
bottom: -1px;
border-bottom: 1px solid #4a4a4a;
}
QTabWidget::pane:left
{
right: -1px;
border-right: 1px solid #4a4a4a;
}
QTabWidget::pane:right
{
left: -1px;
border-left: 1px solid #4a4a4a;
}
QTabWidget::tab-bar:top,
QTabWidget::tab-bar:bottom
{
left: 5px;
}
QTabWidget::tab-bar:left,
QTabWidget::tab-bar:right
{
top: 5px;
}
/*==================================================================================================
QTabBar
==================================================================================================*/
QTabBar
{
qproperty-drawBase: 0; /* important */
background-color: transparent;
}
/* Workaround for QTabBars created from docked QDockWidgets which don't draw the border if not set and reseted as follows: */
QTabBar
{
border-top: 0px;
border-bottom: 1px solid #4a4a4a;
}
QDockWidget QTabBar
{
border-color: transparent; /* set color for all QTabBars but ones created from QDockWidget */
}
QDialog QTabBar
{
border-color: transparent; /* set color for QTabBars inside Preferences dialog */
}
/* end fix */
QTabBar::tab
{
background-color: transparent;
border: 1px solid transparent;
padding: 4px 4px 4px 4px;
margin: 0px;
}
QDialog QTabBar::tab:top
{
background-color: transparent;
border: 1px solid transparent;
padding: 4px 4px 4px 4px;
min-width: 20ex;
}
QTabBar::tab:left,
QTabBar::tab:right
{
border-left-width: 0px;
border-right-width: 4px;
min-height: 9ex;
}
QTabBar::tab:top,
QTabBar::tab:bottom
{
border-top-width: 0px;
border-bottom-width: 4px;
min-width: 9ex;
}
QDialog QTabBar::tab:selected,
QTabBar::tab:selected
{
background-color: #706F77; /* same as tab content background color */
border-color: #4a4a4a;
}
QTabBar::tab:top:selected
{
border-top: 3px solid qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgb(176, 204, 177), stop:1 rgb(115, 133, 116)); /* selection color */
border-bottom-color: #706F77; /* same as tab content background color */
}
QTabBar::tab:bottom:selected
{
border-bottom: 3px solid qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgb(176, 204, 177), stop:1 rgb(115, 133, 116)); /* selection color */
border-right-color: #706F77; /* same as tab content background color */
}
QTabBar::tab:right:selected
{
border-left: 3px solid qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgb(176, 204, 177), stop:1 rgb(115, 133, 116)); /* selection color */
border-right-color: #706F77; /* same as tab content background color */
}
QTabBar::tab:left:selected
{
border-right: 3px solid qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, rgb(176, 204, 177), stop:1 rgb(115, 133, 116)); /* selection color */
border-left-color: #706F77; /* same as tab content background color */
}
QTabBar::tab:first:selected
{
margin-left: 4px; /* the first selected tab has nothing to overlap with on the left */
}
QTabBar::tab:last:selected
{
margin-right: 4px; /* the last selected tab has nothing to overlap with on the right */
}
QTabBar::tab:only-one
{
margin: 0; /* if there is only one tab, we don't want overlapping margins */
}
/*==================================================================================================
QToolBar
==================================================================================================*/
QToolBar
{
padding: 0px;
border: 0px none gray;
background-color: rgb(115, 133, 116);
}
QToolBar > QToolButton
{
margin: 1px;
padding: 1px;
border-radius: 3px;
color: rgb(124, 232, 0);
border: 1px solid rgb(115, 133, 116);
position: relative;
subcontrol-position: right;
subcontrol-origin: margin;
background-color: rgb(115, 133, 116);
}
QDialog > QToolBar > QToolButton
{
width: 95px;
margin: 0px;
padding: 0px;
border-radius: 3px;
border: 1px solid rgb(115, 133, 116);
}
QDialog > QToolBar > QToolButton::menu-button
{
left: -2px;
border-radius: 3px;
border: 1px solid rgb(115, 133, 116);
}
/* when QToolButton is checked: */
QToolBar > QToolButton:checked
{
color: black;
border: 1px solid rgb(150, 179, 190);
background-color: rgb(150, 179, 190);
}
QToolBar > QToolButton:checked:hover
{
border: 1px solid rgb(124, 232, 0);
background-color: rgb(150, 179, 190);
}
QToolBar > QToolButton:hover
{
border: 1px solid rgb(124, 232, 0);
background-color: rgb(115, 133, 116);
}
QToolBar > QToolButton:pressed
{
background-color: rgba(0,0,0,40);
}
QToolBar > QToolButton:disabled
{
background-color: rgba(0, 0, 0, 20);
}
/*==================================================================================================
Remainder from the previous attempt at a stylesheet, dark_windows.qss
==================================================================================================*/
QPushButton
{
margin: 1px;
padding: 4px;
color: black;
background-color: rgb(150, 179, 190);
}
QPushButton:pressed
{
background-color: gray;
}
QPushButton:focus,
QPushButton:hover,
QPushButton:selected
{
outline: none;
border: 1px solid rgb(124, 232, 0);
border-radius: 2px;
}
QPushButton:disabled
{
color: #706F77;
}
QLineEdit, QTextEdit
{
border: 1px solid rgb(150, 179, 190);
color: rgb(221, 255, 130);
background-color: rgb(115, 133, 116);
selection-color: rgb(124, 232, 0);
selection-background-color: rgb(150, 179, 190);
}
QSpinBox,
QDoubleSpinBox
{
padding-right: 0px;
selection-color: rgb(124, 232, 0);
selection-background-color: rgb(150, 179, 190);
}
QCheckBox
{
spacing: 5px;
}
QCheckBox::indicator,
QTableView::indicator,
QGroupBox::indicator,
QTreeView::indicator
{
border-radius: 3px;
}
QCheckBox::indicator:enabled:unchecked,
QTableView::indicator:enabled:unchecked,
QGroupBox::indicator:enabled:unchecked,
QTreeView::indicator:enabled:unchecked
{
background-color: rgb(115, 133, 116);
}
QCheckBox::indicator:enabled:checked,
QTableView::indicator:enabled:checked,
QGroupBox::indicator:enabled:checked,
QTreeView::indicator:enabled:checked
{
background-color: rgb(124, 232, 0);
}
QCheckBox::indicator:disabled:unchecked,
QTableView::indicator:disabled:unchecked,
QGroupBox::indicator:disabled:unchecked,
QTreeView::indicator:disabled:unchecked
{
background-color: gray;
image: none;
}
QCheckBox::indicator:disabled:checked,
QTableView::indicator:disabled:checked,
QGroupBox::indicator:disabled:checked,
QTreeView::indicator:disabled:checked
{
background-color: gray;
image: none;
}
QRadioButton::indicator:checked
{
background-color: rgb(176, 204, 177);
border: 2px solid rgb(115, 133, 116);
border-radius: 7px;
width: 8px;
height: 8px;
margin: 3px;
padding: 1px;
}
QRadioButton::indicator:checked:disabled
{
background-color: rgb(115, 133, 116);
}
QRadioButton::indicator:unchecked
{
border: 2px solid gray;
border-radius: 7px;
width: 8px;
height: 8px;
margin: 3px;
padding: 1px;
}
QComboBox
{
margin: 1px;
padding-left: 4px;
border: 1px solid rgb(176, 204, 177);
selection-background-color: rgb(176, 204, 177);
selection-color: black;
}
QComboBox:disabled
{
border: 1px solid gray;
}
QComboBox::down-arrow:enabled
{
border: 1px solid rgb(124, 232, 0);
margin-right: 2px;
margin-top: 0px;
margin-bottom: 1px;
}
QComboBox::down-arrow:disabled
{
border: 1px solid gray;
margin-right: 2px;
margin-top: 0px;
margin-bottom: 1px;
}
QComboBox::drop-down
{
border: none;
}
QComboBox QAbstractItemView
{
border: 1px solid gray;
outline: none;
selection-background-color: rgb(176, 204, 177);
selection-color: black;
}
QProgressBar
{
color: black;
background-color: gray;
border: 0px none gray;
border-radius: 3px;
text-align: center;
}
QProgressBar::chunk
{
border-radius: 3px;
background-color: rgb(176, 204, 177);
}
QStatusBar QProgressBar
{
min-width: 300px;
max-width: 300px;
margin-right: 4px;
}
QStatusBar QLabel
{
background-color: rgb(115, 133, 116);
}
QGroupBox
{
padding-top: 8px;
border: 2px solid rgb(115, 133, 116);
border-radius: 4px;
margin-top: 3ex;
}
QGroupBox::title
{
subcontrol-origin: border;
subcontrol-position: top left;
margin-top: 1ex;
margin-left: 0px;
padding-right: 0px;
padding-left: 0px;
top: -2ex;
left: 8px;
}
/*Setting this gives a more consistent look. Also, by omitting color and background color, it allows us to set it above with VariationTreeColorNonZero etc...*/
QTreeView
{
border: 1px solid rgb(176, 204, 177);
selection-background-color: #706F77;
}
QTreeView::item
{
outline: none;
margin-right: 1px;
}
QTreeView::item:hover
{
border: 0px none black;
color: rgb(221, 255, 130);
background-color: rgb(115, 133, 116);
outline: none;
}
QTreeView::item:selected
{
border: 0px none black;
color: rgb(221, 255, 130);
background-color: rgb(115, 133, 116);
outline: none;
}
/*Specific controls*/
QLineEdit#PaletteFilterLineEdit,
QLineEdit#VariationsFilterLineEdit
{
height: 20px;
min-height: 20px;
max-height: 20px;
}
QSpinBox#ThreadCountSpin,
QSpinBox#RandomCountSpin,
QSpinBox#CpuSubBatchSpin,
QSpinBox#OpenCLSubBatchSpin,
QSpinBox#CpuQualitySpin,
QSpinBox#OpenCLQualitySpin,
QDoubleSpinBox#OpenCLSubBatchPctSpin,
QSpinBox#FinalRenderCurrentSpin,
QSpinBox#FinalRenderThreadCountSpin,
QDoubleSpinBox#FinalRenderOpenCLSubBatchPctSpin
{
padding: 2px;
border: 1px solid rgb(115, 133, 116);
}
/*
QSpinBox::up-arrow,
QSpinBox::down-arrow
{
background-color: rgb(176, 204, 177);
subcontrol-origin: border;
subcontrol-position: top left;
}
*/
QTableView#FinalRenderParamsTable QComboBox
{
margin-top: 0px;
margin-bottom: 0px;
}
QTableView#FinalRenderParamsTable QPushButton
{
margin-top: 1px;
margin-bottom: 2px;
}
QTableView#XaosTableView QHeaderView::section::vertical,
QTableView#XaosDistVizTableWidget QHeaderView::section::vertical,
QTableView#XaosAppliedTableView QHeaderView::section::vertical
{
width: 19px;
}
QTableView#SummaryTable QHeaderView::section::vertical
{
width: 69px;
}
QssDialog QssTextEdit#QssEdit
{
color: black;
background-color: #FFFCE1;
}
QTextEdit#CreditsTextBrowser
{
color: black;
background-color: #FFFCE1;
}

View File

@ -1784,7 +1784,7 @@ public:
<< "\t\t}\n"
<< "\n"
<< "\t\tvOut.x = fma(" << cosr << ", a, " << sinr << " * r);\n"
<< "\t\tvOut.y = -fma(" << sinr << ", a, " << cosr << " * r);\n"
<< "\t\tvOut.y = fma(-" << sinr << ", a, " << cosr << " * r);\n"
<< "\t\tvOut.z = " << DefaultZCl()
<< "\t}\n";
return ss.str();

View File

@ -360,6 +360,14 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e)
static int fcount = 0;//Qt seems to deliver three events for every key press. So a count must be kept to only respond to the third event.
static int xfupcount = 0;
static int xfdncount = 0;
static int wcount = 0;
static int scount = 0;
static int acount = 0;
static int dcount = 0;
static int qcount = 0;
static int ecount = 0;
static int gcount = 0;
static int hcount = 0;
if (o == ui.GLParentScrollArea && e->type() == QEvent::Resize)
{
@ -406,10 +414,45 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e)
auto focusedctrlEdit = dynamic_cast<QLineEdit*>(this->focusWidget());
auto focusedctrlSpin = dynamic_cast<QSpinBox*>(this->focusWidget());
auto focusedctrlDblSpin = dynamic_cast<QDoubleSpinBox*>(this->focusWidget());
auto focusedctrlCombo = dynamic_cast<QComboBox*>(this->focusWidget());
if (!focusedctrlEdit && !focusedctrlSpin && !focusedctrlDblSpin)//Must exclude these because otherwise, typing a minus key in any of the spinners will switch the xform.
if (!focusedctrlEdit &&
!focusedctrlSpin &&
!focusedctrlDblSpin &&
!focusedctrlCombo)//Must exclude these because otherwise, typing a minus key in any of the spinners will switch the xform.
{
unsigned int index = combo->currentIndex();
double vdist = 0.01;
double hdist = 0.01;
double rot = 1;
double grow = 0.01;
bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
bool pre = true;
if (auto r = m_Controller->Renderer())
{
hdist = std::abs(r->UpperRightX() - r->LowerLeftX()) * 0.01 * m_Controller->AffineScaleLockedToCurrent();
vdist = std::abs(r->UpperRightY() - r->LowerLeftY()) * 0.01 * m_Controller->AffineScaleLockedToCurrent();
if (shift)
{
hdist *= 0.1;
vdist *= 0.1;
rot *= 0.1;
grow *= 0.1;
}
else if (ctrl)
{
hdist *= 10;
vdist *= 10;
rot *= 10;
grow *= 10;
}
}
if (m_Controller.get() && m_Controller->GLController())
pre = m_Controller->GLController()->AffineType() == eAffineType::AffinePre;
if (ke->key() == Qt::Key_Plus || ke->key() == Qt::Key_Equal)
{
@ -441,6 +484,94 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e)
return true;
}
else if (ke->key() == Qt::Key_W)
{
wcount++;
if (wcount >= 3)
{
wcount = 0;
m_Controller->MoveXforms(0, vdist, pre);
}
return true;
}
else if (ke->key() == Qt::Key_S)
{
scount++;
if (scount >= 3)
{
scount = 0;
m_Controller->MoveXforms(0, -vdist, pre);
}
return true;
}
else if (ke->key() == Qt::Key_A)
{
acount++;
if (acount >= 3)
{
acount = 0;
m_Controller->MoveXforms(-hdist, 0, pre);
}
return true;
}
else if (ke->key() == Qt::Key_D)
{
dcount++;
if (dcount >= 3)
{
dcount = 0;
m_Controller->MoveXforms(hdist, 0, pre);
}
return true;
}
else if (ke->key() == Qt::Key_Q)
{
qcount++;
if (qcount >= 3)
{
qcount = 0;
m_Controller->RotateXformsByAngle(-rot, pre);
}
}
else if (ke->key() == Qt::Key_E)
{
ecount++;
if (ecount >= 3)
{
ecount = 0;
m_Controller->RotateXformsByAngle(rot, pre);
}
}
else if (ke->key() == Qt::Key_G)
{
gcount++;
if (gcount >= 3)
{
gcount = 0;
m_Controller->ScaleXforms(1 - grow, pre);
}
}
else if (ke->key() == Qt::Key_H)
{
hcount++;
if (hcount >= 3)
{
hcount = 0;
m_Controller->ScaleXforms(1 + grow, pre);
}
}
}
}
}
@ -1011,6 +1142,7 @@ void Fractorium::SetTabOrders()
/// The logic is:
/// If any cell in the row is non zero, set all cells to zero, else 1.
/// If shift is held down, reverse the logic.
/// If ctrl is held down, set each cell to a random 0 or 1.
/// Resets the rendering process.
/// </summary>
/// <param name="table">The QTableWidget or QTableView whose row will be toggled</param>
@ -1021,6 +1153,7 @@ void Fractorium::ToggleTableRow(QTableView* table, int logicalIndex)
auto model = table->model();
int cols = model->columnCount();
bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
auto tableWidget = qobject_cast<QTableWidget*>(table);
if (tableWidget)
@ -1044,7 +1177,10 @@ void Fractorium::ToggleTableRow(QTableView* table, int logicalIndex)
for (int i = 0; i < cols; i++)
if (auto spinBox = qobject_cast<DoubleSpinBox*>(tableWidget->cellWidget(logicalIndex, i)))
spinBox->setValue(val);
if (ctrl)
spinBox->setValue(double(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRandBit()));
else
spinBox->setValue(val);
}
else
{
@ -1063,7 +1199,10 @@ void Fractorium::ToggleTableRow(QTableView* table, int logicalIndex)
double val = allZero ? 1.0 : 0.0;
for (int i = 0; i < cols; i++)
model->setData(model->index(logicalIndex, i), val, Qt::EditRole);
if (ctrl)
model->setData(model->index(logicalIndex, i), double(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRandBit()), Qt::EditRole);
else
model->setData(model->index(logicalIndex, i), val, Qt::EditRole);
}
}
@ -1072,6 +1211,7 @@ void Fractorium::ToggleTableRow(QTableView* table, int logicalIndex)
/// The logic is:
/// If any cell in the column is non zero, set all cells to zero, else 1.
/// If shift is held down, reverse the logic.
/// If ctrl is held down, set each cell to a random 0 or 1.
/// Resets the rendering process.
/// </summary>
/// <param name="table">The QTableWidget or QTableView whose column will be toggled</param>
@ -1082,6 +1222,7 @@ void Fractorium::ToggleTableCol(QTableView* table, int logicalIndex)
auto model = table->model();
int rows = model->rowCount();
bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
auto tableWidget = qobject_cast<QTableWidget*>(table);
if (tableWidget)
@ -1105,7 +1246,10 @@ void Fractorium::ToggleTableCol(QTableView* table, int logicalIndex)
for (int i = 0; i < rows; i++)
if (auto spinBox = qobject_cast<DoubleSpinBox*>(tableWidget->cellWidget(i, logicalIndex)))
spinBox->setValue(val);
if (ctrl)
spinBox->setValue(double(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRandBit()));
else
spinBox->setValue(val);
}
else
{
@ -1124,7 +1268,10 @@ void Fractorium::ToggleTableCol(QTableView* table, int logicalIndex)
double val = allZero ? 1.0 : 0.0;
for (int i = 0; i < rows; i++)
model->setData(model->index(i, logicalIndex), val, Qt::EditRole);
if (ctrl)
model->setData(model->index(i, logicalIndex), double(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRandBit()), Qt::EditRole);
else
model->setData(model->index(i, logicalIndex), val, Qt::EditRole);
}
}

View File

@ -2784,7 +2784,10 @@
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
@ -4321,7 +4324,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units right</string>
<string>Move xform x units right (D)</string>
</property>
<property name="text">
<string/>
@ -4373,7 +4376,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units up</string>
<string>Move xform x units up (W)</string>
</property>
<property name="text">
<string/>
@ -4457,7 +4460,7 @@
</size>
</property>
<property name="toolTip">
<string>Scale xform x percent up</string>
<string>Scale xform x percent up (H)</string>
</property>
<property name="text">
<string/>
@ -4483,7 +4486,7 @@
</size>
</property>
<property name="toolTip">
<string>Scale xform x percent down</string>
<string>Scale xform x percent down (G)</string>
</property>
<property name="text">
<string/>
@ -4601,7 +4604,7 @@
</size>
</property>
<property name="toolTip">
<string>Rotate xform x degrees clockwise</string>
<string>Rotate xform x degrees clockwise (E)</string>
</property>
<property name="text">
<string/>
@ -4627,7 +4630,7 @@
</size>
</property>
<property name="toolTip">
<string>Rotate xform x degrees counter clockwise</string>
<string>Rotate xform x degrees counter clockwise (Q)</string>
</property>
<property name="text">
<string/>
@ -4732,7 +4735,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units left</string>
<string>Move xform x units left (A)</string>
</property>
<property name="text">
<string/>
@ -4791,7 +4794,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units down</string>
<string>Move xform x units down (S)</string>
</property>
<property name="text">
<string/>
@ -5156,7 +5159,7 @@
</size>
</property>
<property name="toolTip">
<string>Rotate xform x degrees clockwise</string>
<string>Rotate xform x degrees clockwise (E)</string>
</property>
<property name="text">
<string/>
@ -5185,7 +5188,7 @@
</size>
</property>
<property name="toolTip">
<string>Rotate xform x degrees counter clockwise</string>
<string>Rotate xform x degrees counter clockwise (Q)</string>
</property>
<property name="text">
<string/>
@ -5385,7 +5388,7 @@
</size>
</property>
<property name="toolTip">
<string>Scale xform x percent up</string>
<string>Scale xform x percent up (H)</string>
</property>
<property name="text">
<string/>
@ -5414,7 +5417,7 @@
</size>
</property>
<property name="toolTip">
<string>Scale xform x percent down</string>
<string>Scale xform x percent down (G)</string>
</property>
<property name="text">
<string/>
@ -5443,7 +5446,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units left</string>
<string>Move xform x units left (A)</string>
</property>
<property name="text">
<string/>
@ -5508,7 +5511,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units right</string>
<string>Move xform x units right (D)</string>
</property>
<property name="text">
<string/>
@ -5566,7 +5569,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units up</string>
<string>Move xform x units up (W)</string>
</property>
<property name="text">
<string/>
@ -5685,7 +5688,7 @@
</size>
</property>
<property name="toolTip">
<string>Move xform x units down</string>
<string>Move xform x units down (S)</string>
</property>
<property name="text">
<string/>
@ -8258,7 +8261,7 @@
<string>Save the current flame as an xml file</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
<string>Ctrl+T</string>
</property>
</action>
<action name="ActionAbout">
@ -8309,13 +8312,13 @@
<normaloff>:/Fractorium/Icons/068123-3d-transparent-glass-icon-alphanumeric-question-mark3.png</normaloff>:/Fractorium/Icons/068123-3d-transparent-glass-icon-alphanumeric-question-mark3.png</iconset>
</property>
<property name="text">
<string>New &amp;random Flame</string>
<string>New &amp;random flame</string>
</property>
<property name="toolTip">
<string>Add a new random flame to the end of the current file</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
<string>Ctrl+M</string>
</property>
</action>
<action name="ActionSaveEntireFileAsXml">
@ -8333,7 +8336,7 @@
<string>Save all flames as a single xml file</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
<string>Ctrl+Shift+T</string>
</property>
</action>
<action name="ActionAddReflectiveSymmetry">
@ -8380,7 +8383,7 @@
<string>Add a new empty flame to the end of the current file</string>
</property>
<property name="shortcut">
<string>Ctrl+E</string>
<string>Ctrl+Y</string>
</property>
</action>
<action name="ActionCopyFlameInCurrentFile">
@ -8708,7 +8711,7 @@
<string>Alternate editor/image</string>
</property>
<property name="shortcut">
<string>Ctrl+W</string>
<string>Ctrl+L</string>
</property>
</action>
<action name="ActionResetScale">

View File

@ -211,6 +211,8 @@ public:
double LockedY() { return m_LockedY; }
void LockedScale(double scale) { m_LockedScale = scale; }
virtual void InitLockedScale() { }
virtual double AffineScaleCurrentToLocked() { return 0; };
virtual double AffineScaleLockedToCurrent() { return 0; };
//Xforms Color.
virtual void XformColorIndexChanged(double d, bool updateRender, bool updateSpinner, bool updateScroll, eXformUpdate update = eXformUpdate::UPDATE_SELECTED, size_t index = 0) { }
@ -496,10 +498,10 @@ public:
virtual void FillBothAffines() override;
virtual void SwapAffines() override;
virtual void InitLockedScale() override;
virtual double AffineScaleCurrentToLocked() override;
virtual double AffineScaleLockedToCurrent() override;
void FillAffineWithXform(Xform<T>* xform, bool pre);
void ChangeLockedScale(T value);
T AffineScaleCurrentToLocked();
T AffineScaleLockedToCurrent();
//Xforms Color.
virtual void XformColorIndexChanged(double d, bool updateRender, bool updateSpinner, bool updateScroll, eXformUpdate update = eXformUpdate::UPDATE_SELECTED, size_t index = 0) override;

View File

@ -225,6 +225,7 @@ void Fractorium::OnClearXaosButtonClicked(bool checked) { m_Controller->ClearXao
template <typename T>
void FractoriumEmberController<T>::RandomXaos()
{
bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
Update([&]
{
size_t i = 0;
@ -233,7 +234,9 @@ void FractoriumEmberController<T>::RandomXaos()
{
for (size_t j = 0; j < m_Ember.XformCount(); j++)
{
if (m_Rand.RandBit())
if (!ctrl)
xform->SetXaos(j, T(m_Rand.RandBit()));
else if (m_Rand.RandBit())
xform->SetXaos(j, T(m_Rand.RandBit()));
else
xform->SetXaos(j, TruncPrecision(m_Rand.Frand<T>(0, 3), 3));

View File

@ -188,7 +188,7 @@ void FractoriumEmberController<T>::ChangeLockedScale(T value)
/// </summary>
/// <returns>The scale value</returns>
template <typename T>
T FractoriumEmberController<T>::AffineScaleCurrentToLocked()
double FractoriumEmberController<T>::AffineScaleCurrentToLocked()
{
return LockedScale() / m_Ember.m_PixelsPerUnit;
}
@ -198,7 +198,7 @@ T FractoriumEmberController<T>::AffineScaleCurrentToLocked()
/// </summary>
/// <returns>The scale value</returns>
template <typename T>
T FractoriumEmberController<T>::AffineScaleLockedToCurrent()
double FractoriumEmberController<T>::AffineScaleLockedToCurrent()
{
return m_Ember.m_PixelsPerUnit / LockedScale();
}

View File

@ -62,6 +62,7 @@ public:
void ClearShift();
void ClearControl();
eDragState DragState() { return m_DragState; }
eAffineType AffineType() { return m_AffineType; }
virtual void DrawImage() { }
virtual void DrawAffines(bool pre, bool post) { }
virtual void ClearWindow() { }

View File

@ -1996,8 +1996,8 @@ bool GLEmberController<T>::CheckXformHover(Xform<T>* xform, v3T& glCoords, T& be
template <typename T>
void GLEmberController<T>::CalcDragXAxis()
{
auto affineToWorldScale = m_FractoriumEmberController->AffineScaleLockedToCurrent();
auto worldToAffineScale = m_FractoriumEmberController->AffineScaleCurrentToLocked();
T affineToWorldScale = T(m_FractoriumEmberController->AffineScaleLockedToCurrent());
T worldToAffineScale = T(m_FractoriumEmberController->AffineScaleCurrentToLocked());
bool pre = m_AffineType == eAffineType::AffinePre;
bool worldPivotShiftAlt = !m_Fractorium->LocalPivot() && GetShift() && GetAlt();
auto worldRelAxisStartScaled = (v2T(m_HoverHandlePos) * affineToWorldScale) - m_DragSrcTransform.O();//World axis start position, relative, scaled by the zoom.
@ -2161,8 +2161,8 @@ void GLEmberController<T>::CalcDragXAxis()
template <typename T>
void GLEmberController<T>::CalcDragYAxis()
{
auto affineToWorldScale = m_FractoriumEmberController->AffineScaleLockedToCurrent();
auto worldToAffineScale = m_FractoriumEmberController->AffineScaleCurrentToLocked();
T affineToWorldScale = T(m_FractoriumEmberController->AffineScaleLockedToCurrent());
T worldToAffineScale = T(m_FractoriumEmberController->AffineScaleCurrentToLocked());
bool pre = m_AffineType == eAffineType::AffinePre;
bool worldPivotShiftAlt = !m_Fractorium->LocalPivot() && GetShift() && GetAlt();
auto worldRelAxisStartScaled = (v2T(m_HoverHandlePos) * affineToWorldScale) - m_DragSrcTransform.O();//World axis start position, relative, scaled by the zoom.
@ -2321,8 +2321,8 @@ void GLEmberController<T>::CalcDragYAxis()
template <typename T>
void GLEmberController<T>::CalcDragTranslation()
{
auto affineToWorldScale = m_FractoriumEmberController->AffineScaleLockedToCurrent();
auto worldToAffineScale = m_FractoriumEmberController->AffineScaleCurrentToLocked();
T affineToWorldScale = T(m_FractoriumEmberController->AffineScaleLockedToCurrent());
T worldToAffineScale = T(m_FractoriumEmberController->AffineScaleCurrentToLocked());
bool worldPivotShift = !m_Fractorium->LocalPivot() && GetShift();
bool pre = m_AffineType == eAffineType::AffinePre;

View File

@ -115,6 +115,11 @@ public:
QPushButton* m_Button;
};
/// <summary>
/// Thin container that is both a widget and a container of one DoubleSpinBox and one QLabel.
/// Used for when a layout expects a single widget, but two need to go in its place.
/// The widgets are public so the caller can easily use them individually.
/// </summary>
class SpinnerLabelWidget : public QWidget
{
Q_OBJECT
@ -150,6 +155,9 @@ protected:
QHBoxLayout* m_L;
};
/// <summary>
/// Thin derivation that adds a button to a SpinnerLabelWidget.
/// </summary>
class SpinnerLabelButtonWidget : public SpinnerLabelWidget
{
Q_OBJECT
@ -184,7 +192,11 @@ public:
QPushButton* m_Button;
};
/// <summary>
/// Thin container that is both a widget and a container of one DoubleSpinBox and one SpinBox.
/// Used for when a layout expects a single widget, but two need to go in its place.
/// The widgets are public so the caller can easily use them individually.
/// </summary>
class DoubleIntSpinnerWidget : public QWidget
{
Q_OBJECT

View File

@ -97,6 +97,7 @@ cp $EXTRA_LIBS/libtbb.so.2 $FRACTORIUM_LIB
cp $DATA_PATH/dark_linux.qss $FRACTORIUM_BIN
cp $DATA_PATH/lightdark.qss $FRACTORIUM_BIN
cp $DATA_PATH/uranium.qss $FRACTORIUM_BIN
cp $DATA_PATH/flam3-palettes.xml $FRACTORIUM_BIN
cp $DATA_PATH/*.gradient $FRACTORIUM_BIN
cp $DATA_PATH/*.ugr $FRACTORIUM_BIN