mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
Solving Linux-Gnome Palette Editor problem
This commit is contained in:
parent
f29dda2ec0
commit
9fdf512a1f
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
class GLWidget;
|
class GLWidget;
|
||||||
class QssDialog;
|
class QssDialog;
|
||||||
class PaletteEditor; // michel
|
class PaletteEditor;
|
||||||
class FractoriumOptionsDialog;
|
class FractoriumOptionsDialog;
|
||||||
class FractoriumVariationsDialog;
|
class FractoriumVariationsDialog;
|
||||||
class FractoriumFinalRenderDialog;
|
class FractoriumFinalRenderDialog;
|
||||||
@ -360,7 +360,7 @@ public slots:
|
|||||||
void OnPaletteEditorColorChanged();
|
void OnPaletteEditorColorChanged();
|
||||||
void OnPaletteEditorFileChanged();
|
void OnPaletteEditorFileChanged();
|
||||||
void OnPaletteEditorColorIndexChanged(size_t index, float value);
|
void OnPaletteEditorColorIndexChanged(size_t index, float value);
|
||||||
void OnPaletteEditorFinished(int result); // michel
|
void OnPaletteEditorFinished(int result);
|
||||||
|
|
||||||
//Info.
|
//Info.
|
||||||
void OnSummaryTableHeaderResized(int logicalIndex, int oldSize, int newSize);
|
void OnSummaryTableHeaderResized(int logicalIndex, int oldSize, int newSize);
|
||||||
|
@ -249,7 +249,7 @@ public:
|
|||||||
virtual void SetBasePaletteAndAdjust(const Palette<float>& palette) { }
|
virtual void SetBasePaletteAndAdjust(const Palette<float>& palette) { }
|
||||||
virtual void PaletteEditorButtonClicked() { }
|
virtual void PaletteEditorButtonClicked() { }
|
||||||
virtual void PaletteEditorColorChanged() { }
|
virtual void PaletteEditorColorChanged() { }
|
||||||
virtual void SyncPalette(bool accepted) { } // michel
|
virtual void SyncPalette(bool accepted) { }
|
||||||
QImage& FinalPaletteImage() { return m_FinalPaletteImage; }
|
QImage& FinalPaletteImage() { return m_FinalPaletteImage; }
|
||||||
|
|
||||||
//Info.
|
//Info.
|
||||||
@ -311,7 +311,7 @@ protected:
|
|||||||
unique_ptr<EmberNs::RendererBase> m_Renderer;
|
unique_ptr<EmberNs::RendererBase> m_Renderer;
|
||||||
QTIsaac<ISAAC_SIZE, ISAAC_INT> m_Rand;
|
QTIsaac<ISAAC_SIZE, ISAAC_INT> m_Rand;
|
||||||
Fractorium* m_Fractorium;
|
Fractorium* m_Fractorium;
|
||||||
Palette<float> m_TempPalette, m_PreviosTempPalette; // michel
|
Palette<float> m_TempPalette, m_PreviosTempPalette;
|
||||||
std::unique_ptr<QTimer> m_RenderTimer;
|
std::unique_ptr<QTimer> m_RenderTimer;
|
||||||
std::unique_ptr<QTimer> m_RenderRestartTimer;
|
std::unique_ptr<QTimer> m_RenderRestartTimer;
|
||||||
shared_ptr<PaletteList<float>> m_PaletteList;
|
shared_ptr<PaletteList<float>> m_PaletteList;
|
||||||
@ -538,7 +538,7 @@ public:
|
|||||||
virtual void SetBasePaletteAndAdjust(const Palette<float>& palette) override;
|
virtual void SetBasePaletteAndAdjust(const Palette<float>& palette) override;
|
||||||
virtual void PaletteEditorButtonClicked() override;
|
virtual void PaletteEditorButtonClicked() override;
|
||||||
virtual void PaletteEditorColorChanged() override;
|
virtual void PaletteEditorColorChanged() override;
|
||||||
virtual void SyncPalette(bool accepted) override; // michel
|
virtual void SyncPalette(bool accepted) override;
|
||||||
|
|
||||||
//Info.
|
//Info.
|
||||||
virtual void FillSummary() override;
|
virtual void FillSummary() override;
|
||||||
|
@ -396,11 +396,11 @@ void FractoriumEmberController<T>::PaletteEditorButtonClicked()
|
|||||||
ed->SetColorIndices(colorIndices);
|
ed->SetColorIndices(colorIndices);
|
||||||
ed->SetPaletteFile(m_CurrentPaletteFilePath);
|
ed->SetPaletteFile(m_CurrentPaletteFilePath);
|
||||||
|
|
||||||
// michel - waiting to be approved - may be used with IFDEF LINUX
|
#ifdef __linux__
|
||||||
m_PreviosTempPalette = m_TempPalette;
|
m_PreviosTempPalette = m_TempPalette;
|
||||||
ed->SetPreviousColorIndices(colorIndices);
|
ed->SetPreviousColorIndices(colorIndices);
|
||||||
ed->show();
|
ed->show();
|
||||||
return;
|
#else
|
||||||
|
|
||||||
//ed->setpal
|
//ed->setpal
|
||||||
if (ed->exec() == QDialog::Accepted)
|
if (ed->exec() == QDialog::Accepted)
|
||||||
@ -430,6 +430,7 @@ void FractoriumEmberController<T>::PaletteEditorButtonClicked()
|
|||||||
//Whether the current palette file was changed or not, if it's modifiable then reload it just to be safe (even though it might be overkill).
|
//Whether the current palette file was changed or not, if it's modifiable then reload it just to be safe (even though it might be overkill).
|
||||||
if (m_PaletteList->IsModifiable(m_CurrentPaletteFilePath))
|
if (m_PaletteList->IsModifiable(m_CurrentPaletteFilePath))
|
||||||
m_Fractorium->OnPaletteFilenameComboChanged(QString::fromStdString(m_CurrentPaletteFilePath));
|
m_Fractorium->OnPaletteFilenameComboChanged(QString::fromStdString(m_CurrentPaletteFilePath));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -454,7 +455,9 @@ void Fractorium::OnPaletteEditorButtonClicked(bool checked)
|
|||||||
connect(m_PaletteEditor, SIGNAL(PaletteChanged()), this, SLOT(OnPaletteEditorColorChanged()), Qt::QueuedConnection);
|
connect(m_PaletteEditor, SIGNAL(PaletteChanged()), this, SLOT(OnPaletteEditorColorChanged()), Qt::QueuedConnection);
|
||||||
connect(m_PaletteEditor, SIGNAL(PaletteFileChanged()), this, SLOT(OnPaletteEditorFileChanged()), Qt::QueuedConnection);
|
connect(m_PaletteEditor, SIGNAL(PaletteFileChanged()), this, SLOT(OnPaletteEditorFileChanged()), Qt::QueuedConnection);
|
||||||
connect(m_PaletteEditor, SIGNAL(ColorIndexChanged(size_t, float)), this, SLOT(OnPaletteEditorColorIndexChanged(size_t, float)), Qt::QueuedConnection);
|
connect(m_PaletteEditor, SIGNAL(ColorIndexChanged(size_t, float)), this, SLOT(OnPaletteEditorColorIndexChanged(size_t, float)), Qt::QueuedConnection);
|
||||||
connect(m_PaletteEditor, SIGNAL(finished(int)), this, SLOT(OnPaletteEditorFinished(int)), Qt::QueuedConnection); // michel
|
#ifdef __linux__
|
||||||
|
connect(m_PaletteEditor, SIGNAL(finished(int)), this, SLOT(OnPaletteEditorFinished(int)), Qt::QueuedConnection);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
m_PaletteChanged = false;
|
m_PaletteChanged = false;
|
||||||
@ -462,7 +465,6 @@ void Fractorium::OnPaletteEditorButtonClicked(bool checked)
|
|||||||
m_Controller->PaletteEditorButtonClicked();
|
m_Controller->PaletteEditorButtonClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
// michel
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Slot called when palette editor window is closed.
|
/// Slot called when palette editor window is closed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -549,7 +551,6 @@ void Fractorium::OnPaletteEditorColorIndexChanged(size_t index, float value)
|
|||||||
OnXformColorIndexChanged(value, true, true, true, eXformUpdate::UPDATE_SPECIFIC, index);
|
OnXformColorIndexChanged(value, true, true, true, eXformUpdate::UPDATE_SPECIFIC, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// michel
|
|
||||||
/// Slot called after EditPallete is closed.
|
/// Slot called after EditPallete is closed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="result">Cancel/OK action</param>
|
/// <param name="result">Cancel/OK action</param>
|
||||||
|
@ -117,7 +117,6 @@ map<size_t, float> PaletteEditor::GetColorIndices() const
|
|||||||
return m_GradientColorView->GetColorIndices();
|
return m_GradientColorView->GetColorIndices();
|
||||||
}
|
}
|
||||||
|
|
||||||
// michel
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return the previous xform color indices as a map.
|
/// Return the previous xform color indices as a map.
|
||||||
/// The keys are the xform indices, and the values are the color indices.
|
/// The keys are the xform indices, and the values are the color indices.
|
||||||
@ -138,7 +137,6 @@ void PaletteEditor::SetColorIndices(const map<size_t, float>& indices)
|
|||||||
m_GradientColorView->SetColorIndices(indices);
|
m_GradientColorView->SetColorIndices(indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
// michel
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Backup xform color
|
/// Backup xform color
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "FractoriumPch.h"
|
#include "FractoriumPch.h"
|
||||||
#include "Fractorium.h" // michel
|
#include "Fractorium.h"
|
||||||
#include "ColorPickerWidget.h"
|
#include "ColorPickerWidget.h"
|
||||||
#include "GradientColorsView.h"
|
#include "GradientColorsView.h"
|
||||||
#include "EmberFile.h"
|
#include "EmberFile.h"
|
||||||
@ -34,9 +34,9 @@ public:
|
|||||||
Palette<float>& GetPalette(int size);
|
Palette<float>& GetPalette(int size);
|
||||||
void SetPalette(const Palette<float>& palette);
|
void SetPalette(const Palette<float>& palette);
|
||||||
map<size_t, float> GetColorIndices() const;
|
map<size_t, float> GetColorIndices() const;
|
||||||
map<size_t, float> GetPreviousColorIndices() const; // michel
|
map<size_t, float> GetPreviousColorIndices() const;
|
||||||
void SetColorIndices(const map<size_t, float>& indices);
|
void SetColorIndices(const map<size_t, float>& indices);
|
||||||
void SetPreviousColorIndices(const map<size_t, float>& indices); // michel
|
void SetPreviousColorIndices(const map<size_t, float>& indices);
|
||||||
string GetPaletteFile() const;
|
string GetPaletteFile() const;
|
||||||
void SetPaletteFile(const string& filename);
|
void SetPaletteFile(const string& filename);
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ private:
|
|||||||
bool IsCurrentPaletteAndFileEditable();
|
bool IsCurrentPaletteAndFileEditable();
|
||||||
bool m_PaletteFileChanged = false;
|
bool m_PaletteFileChanged = false;
|
||||||
int m_PaletteIndex = 0;
|
int m_PaletteIndex = 0;
|
||||||
map<size_t, float> m_PreviousColorIndices; // michel
|
map<size_t, float> m_PreviousColorIndices;
|
||||||
QString m_Filename;
|
QString m_Filename;
|
||||||
string m_CurrentPaletteFilePath;
|
string m_CurrentPaletteFilePath;
|
||||||
ColorPickerWidget* m_ColorPicker = nullptr;
|
ColorPickerWidget* m_ColorPicker = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user