mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-06-30 13:26:02 -04:00
--User changes
-Give tabs a height of 4px in the qss files. Looks a little large on 4k screens, but just right on HD screens which are much more common. -Allow for styling of zero and non-zero variation tree nodes via qss. -Allow for toggling whether to interpolate between colors in the palette editor, or to do hard cuts between colors. -Allow for adjusting spinner values with the + = or up arrow keys to increase, and - _ or down arrow keys to decrease. -Allow for responding to global presses of + = and - _ to cycle up or down to specify which xform is set as the current one. -Allow for adding "layers" via xaos which will add a user-specified number of xforms, and set certain xaos values to 0 or 1. -Add a new menu item under the Edit menu to copy the OpenCL iteration kernel source to the clipboard. -Show text on the status bar which indicates that an OpenCL kernel compilation is taking place. -Show xform name on xform combo box when expanded. Adjust size to fit all names. -Draw post affine circles using dashed lines. -Prevent QSS dialog from styling its editor, which makes it easier to see text when creating styles which have custom colors for text boxes. --Bug fixes -Fix up some table layouts which seemed to have regressed/decayed over time for reasons unknown. -Using undo/redo would create a new flame in the library every time. -Solo was not being preserved when using undo/redo. --Code changes -Make the solo flag be a part of the flame data now. -Fix some tabification in the OpenCL code for EllipticVariation. -Fix tabification in the varState code for OpenCL. -Add an event called m_CompileBegun to RendererCL that is called right before an OpenCL compile is begun. --This required making RendererCLBase not a pure virtual base class. Member functions just return defaults. -Filter key presses on main window to only process the third one. This is due to Qt triggering three events for every key press. -The palette preview table was installing an event filter for seemingly no reason. Remove it. -Mark certain virtual functions as override in SpinBox and DoubleSpinBox.
This commit is contained in:
@ -89,10 +89,6 @@ Fractorium::Fractorium(QWidget* p)
|
||||
pixmap.fill(m_XformComboColors[i]);
|
||||
m_XformComboIcons[i] = QIcon(pixmap);
|
||||
}
|
||||
|
||||
//Set Default VariationTreeBgColor
|
||||
m_VariationTreeBgColorNoneZero=QColor(200,200,200);
|
||||
m_VariationTreeBgColorZero=QColor(255,255,255);
|
||||
|
||||
QPixmap pixmap(iconSize_, iconSize_);
|
||||
pixmap.fill(m_FinalXformComboColor);
|
||||
@ -348,6 +344,11 @@ void Fractorium::dockLocationChanged(Qt::DockWidgetArea area)
|
||||
/// <returns>false</returns>
|
||||
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 libdelcount = 0;//Note that if anything ever changes under the hood with Qt, this will likely stop working, so adjust as accordingly.
|
||||
static int xfupcount = 0;
|
||||
static int xfdncount = 0;
|
||||
|
||||
if (o == ui.GLParentScrollArea && e->type() == QEvent::Resize)
|
||||
{
|
||||
m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width() * ui.GLDisplay->devicePixelRatioF());
|
||||
@ -355,24 +356,79 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e)
|
||||
}
|
||||
else if (auto ke = dynamic_cast<QKeyEvent*>(e))
|
||||
{
|
||||
auto combo = ui.CurrentXformCombo;
|
||||
bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
|
||||
|
||||
if (ke->key() >= Qt::Key_F1 && ke->key() <= Qt::Key_F32)
|
||||
{
|
||||
int val = ke->key() - (int)Qt::Key_F1;
|
||||
fcount++;
|
||||
|
||||
if (val < ui.CurrentXformCombo->count())
|
||||
ui.CurrentXformCombo->setCurrentIndex(val);
|
||||
if (fcount >= 3)
|
||||
{
|
||||
int val = ke->key() - (int)Qt::Key_F1;
|
||||
|
||||
if (val < combo->count())
|
||||
combo->setCurrentIndex(val);
|
||||
|
||||
fcount = 0;
|
||||
qDebug() << "global function key press: " << ke->key() << " " << o->metaObject()->className() << " " << o->objectName();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (o == ui.LibraryTree)
|
||||
{
|
||||
//Require shift for deleting to prevent it from triggering when the user enters delete in the edit box.
|
||||
if (ke->key() == Qt::Key_Delete && e->type() == QEvent::KeyRelease && shift)
|
||||
{
|
||||
auto v = GetCurrentEmberIndex();
|
||||
libdelcount++;
|
||||
|
||||
if (ui.LibraryTree->topLevelItem(0)->childCount() > 1)
|
||||
OnDelete(v);
|
||||
if (libdelcount >= 3)
|
||||
{
|
||||
auto v = GetCurrentEmberIndex();
|
||||
|
||||
if (ui.LibraryTree->topLevelItem(0)->childCount() > 1)
|
||||
OnDelete(v);
|
||||
|
||||
libdelcount = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (o == this)
|
||||
{
|
||||
unsigned int index = combo->currentIndex();
|
||||
|
||||
if (ke->key() == Qt::Key_Plus || ke->key() == Qt::Key_Equal)
|
||||
{
|
||||
xfupcount++;
|
||||
|
||||
if (xfupcount >= 3)
|
||||
{
|
||||
xfupcount = 0;
|
||||
combo->setCurrentIndex((index + 1) % combo->count());
|
||||
qDebug() << "global arrow plus key press: " << ke->key() << " " << o->metaObject()->className() << " " << o->objectName();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (ke->key() == Qt::Key_Minus || ke->key() == Qt::Key_Underscore)
|
||||
{
|
||||
xfdncount++;
|
||||
|
||||
if (xfdncount >= 3)
|
||||
{
|
||||
xfdncount = 0;
|
||||
|
||||
if (index == 0)
|
||||
index = combo->count();
|
||||
|
||||
combo->setCurrentIndex((index - 1) % combo->count());
|
||||
qDebug() << "global arrow minus key press: " << ke->key() << " " << o->metaObject()->className() << " " << o->objectName();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -866,6 +922,10 @@ void Fractorium::SetTabOrders()
|
||||
w = SetTabOrder(this, w, ui.WorldPivotRadio);
|
||||
w = SetTabOrder(this, ui.VariationsFilterLineEdit, ui.VariationsFilterClearButton);//Xforms variation.
|
||||
w = SetTabOrder(this, w, ui.VariationsTree);
|
||||
w = SetTabOrder(this, w, ui.ClearXaosButton);
|
||||
w = SetTabOrder(this, w, ui.RandomXaosButton);
|
||||
w = SetTabOrder(this, w, ui.AddLayerButton);
|
||||
w = SetTabOrder(this, w, ui.AddLayerSpinBox);
|
||||
//Xforms xaos is done dynamically every time.
|
||||
w = SetTabOrder(this, ui.PaletteFilenameCombo, m_PaletteHueSpin);//Palette.
|
||||
w = SetTabOrder(this, w, m_PaletteContrastSpin);
|
||||
|
Reference in New Issue
Block a user