mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-02 14:26:17 -04:00
Solving Gnome Palette Editor problem
This commit is contained in:
@ -117,6 +117,17 @@ map<size_t, float> PaletteEditor::GetColorIndices() const
|
||||
return m_GradientColorView->GetColorIndices();
|
||||
}
|
||||
|
||||
// michel
|
||||
/// <summary>
|
||||
/// Return the previous xform color indices as a map.
|
||||
/// The keys are the xform indices, and the values are the color indices.
|
||||
/// </summary>
|
||||
/// <returns>The color indices</returns>
|
||||
map<size_t, float> PaletteEditor::GetPreviousColorIndices() const
|
||||
{
|
||||
return m_PreviousColorIndices;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assign the values of the xform color indices to the arrows.
|
||||
/// This will clear out any existing values first.
|
||||
@ -127,6 +138,16 @@ void PaletteEditor::SetColorIndices(const map<size_t, float>& indices)
|
||||
m_GradientColorView->SetColorIndices(indices);
|
||||
}
|
||||
|
||||
// michel
|
||||
/// <summary>
|
||||
/// Backup xform color
|
||||
/// </summary>
|
||||
/// <param name="indices">The color indices to backup</param>
|
||||
void PaletteEditor::SetPreviousColorIndices(const map<size_t, float>& indices)
|
||||
{
|
||||
m_PreviousColorIndices = indices;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the filename of the currently selected palette.
|
||||
/// Note this will only be filled in if the user has clicked in the palette
|
||||
@ -636,4 +657,4 @@ void PaletteEditor::EnablePaletteControls()
|
||||
bool PaletteEditor::IsCurrentPaletteAndFileEditable()
|
||||
{
|
||||
return m_PaletteList->IsModifiable(m_CurrentPaletteFilePath) && !m_GradientColorView->GetPalette(256).m_SourceColors.empty();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "FractoriumPch.h"
|
||||
#include "Fractorium.h" // michel
|
||||
#include "ColorPickerWidget.h"
|
||||
#include "GradientColorsView.h"
|
||||
#include "EmberFile.h"
|
||||
@ -26,14 +27,16 @@ class PaletteEditor : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PaletteEditor(QWidget* p = nullptr);
|
||||
explicit PaletteEditor(QWidget* p = nullptr);
|
||||
|
||||
public:
|
||||
bool Sync();
|
||||
Palette<float>& GetPalette(int size);
|
||||
void SetPalette(const Palette<float>& palette);
|
||||
map<size_t, float> GetColorIndices() const;
|
||||
map<size_t, float> GetPreviousColorIndices() const; // michel
|
||||
void SetColorIndices(const map<size_t, float>& indices);
|
||||
void SetPreviousColorIndices(const map<size_t, float>& indices); // michel
|
||||
string GetPaletteFile() const;
|
||||
void SetPaletteFile(const string& filename);
|
||||
|
||||
@ -77,6 +80,7 @@ private:
|
||||
bool IsCurrentPaletteAndFileEditable();
|
||||
bool m_PaletteFileChanged = false;
|
||||
int m_PaletteIndex = 0;
|
||||
map<size_t, float> m_PreviousColorIndices; // michel
|
||||
QString m_Filename;
|
||||
string m_CurrentPaletteFilePath;
|
||||
ColorPickerWidget* m_ColorPicker = nullptr;
|
||||
|
Reference in New Issue
Block a user