mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 23:42:57 +00:00
Rename PalEdit to PaletteView widget to avoid confusion with the palette editor command.
This commit is contained in:
parent
ed2c870059
commit
6ef082ad7f
@ -242,7 +242,7 @@ add_library(aseprite-library
|
||||
widgets/fileview.cpp
|
||||
widgets/groupbut.cpp
|
||||
widgets/menuitem.cpp
|
||||
widgets/paledit.cpp
|
||||
widgets/palette_view.cpp
|
||||
widgets/preview.cpp
|
||||
widgets/statebar.cpp
|
||||
widgets/tabs.cpp
|
||||
|
@ -51,7 +51,7 @@
|
||||
#include "widgets/color_bar.h"
|
||||
#include "widgets/colview.h"
|
||||
#include "widgets/editor.h"
|
||||
#include "widgets/paledit.h"
|
||||
#include "widgets/palette_view.h"
|
||||
#include "widgets/statebar.h"
|
||||
|
||||
using namespace gfx;
|
||||
@ -162,7 +162,7 @@ static Slider *H_slider, *S_slider, *V_slider;
|
||||
static Widget *R_entry, *G_entry, *B_entry;
|
||||
static Widget *H_entry, *S_entry, *V_entry;
|
||||
static Widget *hex_entry;
|
||||
static PalEdit* palette_editor;
|
||||
static PaletteView* palette_editor;
|
||||
static Widget* more_options = NULL;
|
||||
static bool disable_colorbar_signals = false;
|
||||
|
||||
@ -299,7 +299,7 @@ void PaletteEditorCommand::onExecute(Context* context)
|
||||
|
||||
// Custom widgets
|
||||
if (first_time) {
|
||||
palette_editor = new PalEdit(true);
|
||||
palette_editor = new PaletteView(true);
|
||||
palette_editor->setBoxSize(4*jguiscale());
|
||||
|
||||
jview_attach(palette_editor_view, palette_editor);
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "ui_context.h"
|
||||
#include "widgets/color_bar.h"
|
||||
#include "widgets/color_selector.h"
|
||||
#include "widgets/paledit.h"
|
||||
#include "widgets/statebar.h"
|
||||
|
||||
#define COLORBAR_MAX_COLORS 256
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "raster/image.h"
|
||||
#include "raster/palette.h"
|
||||
#include "widgets/color_selector.h"
|
||||
#include "widgets/paledit.h"
|
||||
#include "widgets/palette_view.h"
|
||||
|
||||
enum {
|
||||
MODEL_RGB,
|
||||
@ -87,7 +87,7 @@ Frame* colorselector_new()
|
||||
Grid* grid1 = new Grid(2, false);
|
||||
Grid* grid2 = new Grid(5, false);
|
||||
Box* models_box = new Box(JI_HORIZONTAL);
|
||||
PalEdit* pal = new PalEdit(false);
|
||||
PaletteView* pal = new PaletteView(false);
|
||||
Label* idx = new Label("None");
|
||||
Widget* child;
|
||||
ColorSelector* colorselector = new ColorSelector;
|
||||
@ -262,7 +262,7 @@ static bool colorselector_msg_proc(JWidget widget, JMessage msg)
|
||||
case JM_SIGNAL:
|
||||
if (msg->signal.num == JI_SIGNAL_INIT_THEME) {
|
||||
Widget* idx = widget->findChild("idx");
|
||||
PalEdit* pal = static_cast<PalEdit*>(widget->findChild("pal"));
|
||||
PaletteView* pal = static_cast<PaletteView*>(widget->findChild("pal"));
|
||||
Widget* grid2 = widget->findChild("grid2");
|
||||
int idxlen = ji_font_text_len(idx->getFont(), "Index=888");
|
||||
|
||||
@ -363,7 +363,7 @@ static void colorselector_set_color2(JWidget widget, const Color& color,
|
||||
|
||||
static void colorselector_set_paledit_index(JWidget widget, int index, bool select_index_entry)
|
||||
{
|
||||
PalEdit* pal = static_cast<PalEdit*>(widget->findChild("pal"));
|
||||
PaletteView* pal = static_cast<PaletteView*>(widget->findChild("pal"));
|
||||
Widget* idx = widget->findChild("idx");
|
||||
char buf[256];
|
||||
|
||||
@ -477,7 +477,7 @@ static void slider_change_hook(Slider* widget)
|
||||
static bool paledit_change_hook(Widget* widget, void* data)
|
||||
{
|
||||
Frame* window = static_cast<Frame*>(widget->getRoot());
|
||||
PalEdit* paledit = static_cast<PalEdit*>(widget);
|
||||
PaletteView* paledit = static_cast<PaletteView*>(widget);
|
||||
bool array[256];
|
||||
Color color = colorselector_get_color(window);
|
||||
int i;
|
||||
|
@ -35,11 +35,11 @@
|
||||
#include "raster/blend.h"
|
||||
#include "raster/image.h"
|
||||
#include "raster/palette.h"
|
||||
#include "widgets/paledit.h"
|
||||
#include "widgets/palette_view.h"
|
||||
|
||||
#define COLOR_SIZE (m_boxsize)
|
||||
|
||||
static int paledit_type()
|
||||
static int palette_view_type()
|
||||
{
|
||||
static int type = 0;
|
||||
if (!type)
|
||||
@ -47,8 +47,8 @@ static int paledit_type()
|
||||
return type;
|
||||
}
|
||||
|
||||
PalEdit::PalEdit(bool editable)
|
||||
: Widget(paledit_type())
|
||||
PaletteView::PaletteView(bool editable)
|
||||
: Widget(palette_view_type())
|
||||
{
|
||||
m_editable = editable;
|
||||
m_range_type = PALETTE_EDITOR_RANGE_NONE;
|
||||
@ -64,17 +64,17 @@ PalEdit::PalEdit(bool editable)
|
||||
this->child_spacing = 1 * jguiscale();
|
||||
}
|
||||
|
||||
int PalEdit::getRangeType()
|
||||
int PaletteView::getRangeType()
|
||||
{
|
||||
return m_range_type;
|
||||
}
|
||||
|
||||
int PalEdit::getColumns()
|
||||
int PaletteView::getColumns()
|
||||
{
|
||||
return m_columns;
|
||||
}
|
||||
|
||||
void PalEdit::setColumns(int columns)
|
||||
void PaletteView::setColumns(int columns)
|
||||
{
|
||||
int old_columns = m_columns;
|
||||
|
||||
@ -90,12 +90,12 @@ void PalEdit::setColumns(int columns)
|
||||
}
|
||||
}
|
||||
|
||||
void PalEdit::setBoxSize(int boxsize)
|
||||
void PaletteView::setBoxSize(int boxsize)
|
||||
{
|
||||
m_boxsize = boxsize;
|
||||
}
|
||||
|
||||
void PalEdit::selectColor(int index)
|
||||
void PaletteView::selectColor(int index)
|
||||
{
|
||||
ASSERT(index >= 0 && index <= 255);
|
||||
|
||||
@ -113,7 +113,7 @@ void PalEdit::selectColor(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void PalEdit::selectRange(int begin, int end, int range_type)
|
||||
void PaletteView::selectRange(int begin, int end, int range_type)
|
||||
{
|
||||
/* ASSERT(begin >= 0 && begin <= 255); */
|
||||
/* ASSERT(end >= 0 && end <= 255); */
|
||||
@ -135,7 +135,7 @@ static void swap_color(Palette* palette, int i1, int i2)
|
||||
palette->setEntry(i1, c2);
|
||||
}
|
||||
|
||||
void PalEdit::moveSelection(int x, int y)
|
||||
void PaletteView::moveSelection(int x, int y)
|
||||
{
|
||||
if (!m_editable)
|
||||
return;
|
||||
@ -266,17 +266,17 @@ void PalEdit::moveSelection(int x, int y)
|
||||
jmanager_refresh_screen();
|
||||
}
|
||||
|
||||
int PalEdit::get1stColor()
|
||||
int PaletteView::get1stColor()
|
||||
{
|
||||
return m_color[0];
|
||||
}
|
||||
|
||||
int PalEdit::get2ndColor()
|
||||
int PaletteView::get2ndColor()
|
||||
{
|
||||
return m_color[1];
|
||||
}
|
||||
|
||||
void PalEdit::getSelectedEntries(bool array[256])
|
||||
void PaletteView::getSelectedEntries(bool array[256])
|
||||
{
|
||||
memset(array, false, sizeof(bool)*256);
|
||||
|
||||
@ -326,7 +326,7 @@ void PalEdit::getSelectedEntries(bool array[256])
|
||||
}
|
||||
}
|
||||
|
||||
bool PalEdit::onProcessMessage(JMessage msg)
|
||||
bool PaletteView::onProcessMessage(JMessage msg)
|
||||
{
|
||||
switch (msg->type) {
|
||||
|
||||
@ -558,7 +558,7 @@ bool PalEdit::onProcessMessage(JMessage msg)
|
||||
return Widget::onProcessMessage(msg);
|
||||
}
|
||||
|
||||
void PalEdit::request_size(int* w, int* h)
|
||||
void PaletteView::request_size(int* w, int* h)
|
||||
{
|
||||
div_t d = div(256, m_columns);
|
||||
int cols = m_columns;
|
||||
@ -571,7 +571,7 @@ void PalEdit::request_size(int* w, int* h)
|
||||
+ rows*COLOR_SIZE + (rows-1)*this->child_spacing;
|
||||
}
|
||||
|
||||
void PalEdit::update_scroll(int color)
|
||||
void PaletteView::update_scroll(int color)
|
||||
{
|
||||
Widget* view = jwidget_get_view(this);
|
||||
if (view != NULL) {
|
@ -16,8 +16,8 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef WIDGETS_PALEDIT_H_INCLUDED
|
||||
#define WIDGETS_PALEDIT_H_INCLUDED
|
||||
#ifndef WIDGETS_PALETTE_VIEW_H_INCLUDED
|
||||
#define WIDGETS_PALETTE_VIEW_H_INCLUDED
|
||||
|
||||
#include <allegro/color.h>
|
||||
|
||||
@ -32,10 +32,10 @@ enum {
|
||||
PALETTE_EDITOR_RANGE_RECTANGULAR,
|
||||
};
|
||||
|
||||
class PalEdit : public Widget
|
||||
class PaletteView : public Widget
|
||||
{
|
||||
public:
|
||||
PalEdit(bool editable);
|
||||
PaletteView(bool editable);
|
||||
|
||||
int getRangeType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user