mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 21:46:20 +00:00
Hide "Index" tab in FG/BG color popups
The "Index" tab doesn't make sense in the foreground/background color selector because we already have the color bar at the left of the screen to click on a palette entry.
This commit is contained in:
parent
84282764ee
commit
0ced31a447
@ -101,10 +101,10 @@ void MaskByColorCommand::onExecute(Context* context)
|
|||||||
box4 = new Box(HORIZONTAL | HOMOGENEOUS);
|
box4 = new Box(HORIZONTAL | HOMOGENEOUS);
|
||||||
label_color = new Label("Color:");
|
label_color = new Label("Color:");
|
||||||
m_buttonColor = new ColorButton
|
m_buttonColor = new ColorButton
|
||||||
(get_config_color("MaskColor", "Color",
|
(get_config_color("MaskColor", "Color",
|
||||||
ColorBar::instance()->getFgColor()),
|
ColorBar::instance()->getFgColor()),
|
||||||
sprite->pixelFormat(),
|
sprite->pixelFormat(),
|
||||||
false, false);
|
ColorButtonOptions());
|
||||||
label_tolerance = new Label("Tolerance:");
|
label_tolerance = new Label("Tolerance:");
|
||||||
m_sliderTolerance = new Slider(0, 255, get_config_int("MaskColor", "Tolerance", 0));
|
m_sliderTolerance = new Slider(0, 255, get_config_int("MaskColor", "Tolerance", 0));
|
||||||
m_checkPreview = new CheckBox("&Preview");
|
m_checkPreview = new CheckBox("&Preview");
|
||||||
|
@ -107,7 +107,7 @@ void SpritePropertiesCommand::onExecute(Context* context)
|
|||||||
if (sprite->pixelFormat() == IMAGE_INDEXED) {
|
if (sprite->pixelFormat() == IMAGE_INDEXED) {
|
||||||
color_button = new ColorButton(app::Color::fromIndex(sprite->transparentColor()),
|
color_button = new ColorButton(app::Color::fromIndex(sprite->transparentColor()),
|
||||||
IMAGE_INDEXED,
|
IMAGE_INDEXED,
|
||||||
false, false);
|
ColorButtonOptions());
|
||||||
|
|
||||||
window.transparentColorPlaceholder()->addChild(color_button);
|
window.transparentColorPlaceholder()->addChild(color_button);
|
||||||
}
|
}
|
||||||
|
@ -118,8 +118,8 @@ ColorBar::ColorBar(int align)
|
|||||||
, m_tintShadeTone(nullptr)
|
, m_tintShadeTone(nullptr)
|
||||||
, m_spectrum(nullptr)
|
, m_spectrum(nullptr)
|
||||||
, m_wheel(nullptr)
|
, m_wheel(nullptr)
|
||||||
, m_fgColor(app::Color::fromRgb(255, 255, 255), IMAGE_RGB, true, false)
|
, m_fgColor(app::Color::fromRgb(255, 255, 255), IMAGE_RGB, ColorBarButtonsOptions())
|
||||||
, m_bgColor(app::Color::fromRgb(0, 0, 0), IMAGE_RGB, true, false)
|
, m_bgColor(app::Color::fromRgb(0, 0, 0), IMAGE_RGB, ColorBarButtonsOptions())
|
||||||
, m_fgWarningIcon(new WarningIcon)
|
, m_fgWarningIcon(new WarningIcon)
|
||||||
, m_bgWarningIcon(new WarningIcon)
|
, m_bgWarningIcon(new WarningIcon)
|
||||||
, m_fromPalView(false)
|
, m_fromPalView(false)
|
||||||
|
@ -43,15 +43,13 @@ static WidgetType colorbutton_type()
|
|||||||
|
|
||||||
ColorButton::ColorButton(const app::Color& color,
|
ColorButton::ColorButton(const app::Color& color,
|
||||||
const PixelFormat pixelFormat,
|
const PixelFormat pixelFormat,
|
||||||
const bool canPinSelector,
|
const ColorButtonOptions& options)
|
||||||
const bool showSimpleColors)
|
|
||||||
: ButtonBase("", colorbutton_type(), kButtonWidget, kButtonWidget)
|
: ButtonBase("", colorbutton_type(), kButtonWidget, kButtonWidget)
|
||||||
, m_color(color)
|
, m_color(color)
|
||||||
, m_pixelFormat(pixelFormat)
|
, m_pixelFormat(pixelFormat)
|
||||||
, m_window(nullptr)
|
, m_window(nullptr)
|
||||||
, m_dependOnLayer(false)
|
, m_dependOnLayer(false)
|
||||||
, m_canPinSelector(canPinSelector)
|
, m_options(options)
|
||||||
, m_showSimpleColors(showSimpleColors)
|
|
||||||
{
|
{
|
||||||
setFocusStop(true);
|
setFocusStop(true);
|
||||||
initTheme();
|
initTheme();
|
||||||
@ -96,7 +94,7 @@ void ColorButton::setColor(const app::Color& origColor)
|
|||||||
// BeforeChange() has changed the color type (e.g. to index), we
|
// BeforeChange() has changed the color type (e.g. to index), we
|
||||||
// don't care, in the window we prefer to keep the original
|
// don't care, in the window we prefer to keep the original
|
||||||
// HSV/HSL values.
|
// HSV/HSL values.
|
||||||
m_window->setColor(origColor, ColorPopup::DoNotChangeType);
|
m_window->setColor(origColor, ColorPopup::DontChangeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit signal
|
// Emit signal
|
||||||
@ -264,7 +262,7 @@ void ColorButton::onClick(Event& ev)
|
|||||||
|
|
||||||
void ColorButton::onLoadLayout(ui::LoadLayoutEvent& ev)
|
void ColorButton::onLoadLayout(ui::LoadLayoutEvent& ev)
|
||||||
{
|
{
|
||||||
if (m_canPinSelector) {
|
if (canPin()) {
|
||||||
bool pinned = false;
|
bool pinned = false;
|
||||||
ev.stream() >> pinned;
|
ev.stream() >> pinned;
|
||||||
if (ev.stream() && pinned)
|
if (ev.stream() && pinned)
|
||||||
@ -274,7 +272,7 @@ void ColorButton::onLoadLayout(ui::LoadLayoutEvent& ev)
|
|||||||
|
|
||||||
void ColorButton::onSaveLayout(ui::SaveLayoutEvent& ev)
|
void ColorButton::onSaveLayout(ui::SaveLayoutEvent& ev)
|
||||||
{
|
{
|
||||||
if (m_canPinSelector && m_window && m_window->isPinned())
|
if (canPin() && m_window && m_window->isPinned())
|
||||||
ev.stream() << 1 << ' ' << m_window->bounds();
|
ev.stream() << 1 << ' ' << m_window->bounds();
|
||||||
else
|
else
|
||||||
ev.stream() << 0;
|
ev.stream() << 0;
|
||||||
@ -285,7 +283,7 @@ void ColorButton::openSelectorDialog()
|
|||||||
bool pinned = (!m_windowDefaultBounds.isEmpty());
|
bool pinned = (!m_windowDefaultBounds.isEmpty());
|
||||||
|
|
||||||
if (m_window == NULL) {
|
if (m_window == NULL) {
|
||||||
m_window = new ColorPopup(m_canPinSelector, m_showSimpleColors);
|
m_window = new ColorPopup(m_options);
|
||||||
m_window->ColorChange.connect(&ColorButton::onWindowColorChange, this);
|
m_window->ColorChange.connect(&ColorButton::onWindowColorChange, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,7 +337,7 @@ void ColorButton::onActiveSiteChange(const Site& site)
|
|||||||
if (m_dependOnLayer)
|
if (m_dependOnLayer)
|
||||||
invalidate();
|
invalidate();
|
||||||
|
|
||||||
if (m_canPinSelector) {
|
if (canPin()) {
|
||||||
// Hide window
|
// Hide window
|
||||||
if (!site.document()) {
|
if (!site.document()) {
|
||||||
if (m_window)
|
if (m_window)
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "app/color.h"
|
#include "app/color.h"
|
||||||
|
#include "app/ui/color_button_options.h"
|
||||||
#include "app/ui/color_source.h"
|
#include "app/ui/color_source.h"
|
||||||
#include "doc/context_observer.h"
|
#include "doc/context_observer.h"
|
||||||
#include "doc/pixel_format.h"
|
#include "doc/pixel_format.h"
|
||||||
@ -28,8 +29,7 @@ namespace app {
|
|||||||
public:
|
public:
|
||||||
ColorButton(const app::Color& color,
|
ColorButton(const app::Color& color,
|
||||||
const PixelFormat pixelFormat,
|
const PixelFormat pixelFormat,
|
||||||
const bool canPinSelector,
|
const ColorButtonOptions& options);
|
||||||
const bool showSimpleColors);
|
|
||||||
~ColorButton();
|
~ColorButton();
|
||||||
|
|
||||||
PixelFormat pixelFormat() const;
|
PixelFormat pixelFormat() const;
|
||||||
@ -60,14 +60,14 @@ namespace app {
|
|||||||
void closeSelectorDialog();
|
void closeSelectorDialog();
|
||||||
void onWindowColorChange(const app::Color& color);
|
void onWindowColorChange(const app::Color& color);
|
||||||
void onActiveSiteChange(const Site& site) override;
|
void onActiveSiteChange(const Site& site) override;
|
||||||
|
bool canPin() const { return m_options.canPinSelector; }
|
||||||
|
|
||||||
app::Color m_color;
|
app::Color m_color;
|
||||||
PixelFormat m_pixelFormat;
|
PixelFormat m_pixelFormat;
|
||||||
ColorPopup* m_window;
|
ColorPopup* m_window;
|
||||||
gfx::Rect m_windowDefaultBounds;
|
gfx::Rect m_windowDefaultBounds;
|
||||||
bool m_dependOnLayer;
|
bool m_dependOnLayer;
|
||||||
bool m_canPinSelector;
|
ColorButtonOptions m_options;
|
||||||
bool m_showSimpleColors;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
38
src/app/ui/color_button_options.h
Normal file
38
src/app/ui/color_button_options.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// Aseprite
|
||||||
|
// Copyright (C) 2017 David Capello
|
||||||
|
//
|
||||||
|
// This program is distributed under the terms of
|
||||||
|
// the End-User License Agreement for Aseprite.
|
||||||
|
|
||||||
|
#ifndef APP_UI_COLOR_BUTTON_OPTIONS_H_INCLUDED
|
||||||
|
#define APP_UI_COLOR_BUTTON_OPTIONS_H_INCLUDED
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace app {
|
||||||
|
|
||||||
|
struct ColorButtonOptions {
|
||||||
|
bool canPinSelector;
|
||||||
|
bool showSimpleColors;
|
||||||
|
bool showIndexTab;
|
||||||
|
|
||||||
|
ColorButtonOptions() {
|
||||||
|
// Default values for regular color buttons in dialogs like
|
||||||
|
// "Replace Color"
|
||||||
|
canPinSelector = false;
|
||||||
|
showSimpleColors = false;
|
||||||
|
showIndexTab = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ColorBarButtonsOptions : public ColorButtonOptions {
|
||||||
|
ColorBarButtonsOptions() {
|
||||||
|
// Default values for color buttons inside the color bar
|
||||||
|
canPinSelector = true;
|
||||||
|
showSimpleColors = false;
|
||||||
|
showIndexTab = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace app
|
||||||
|
|
||||||
|
#endif
|
@ -164,21 +164,24 @@ void ColorPopup::CustomButtonSet::onSelectItem(Item* item, bool focusItem, ui::M
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorPopup::ColorPopup(const bool canPin,
|
ColorPopup::ColorPopup(const ColorButtonOptions& options)
|
||||||
bool showSimpleColors)
|
|
||||||
: PopupWindowPin(" ", // Non-empty to create title-bar and close button
|
: PopupWindowPin(" ", // Non-empty to create title-bar and close button
|
||||||
ClickBehavior::CloseOnClickInOtherWindow,
|
ClickBehavior::CloseOnClickInOtherWindow,
|
||||||
canPin)
|
options.canPinSelector)
|
||||||
, m_vbox(VERTICAL)
|
, m_vbox(VERTICAL)
|
||||||
, m_topBox(HORIZONTAL)
|
, m_topBox(HORIZONTAL)
|
||||||
, m_color(app::Color::fromMask())
|
, m_color(app::Color::fromMask())
|
||||||
, m_colorPalette(false, PaletteView::SelectOneColor, this, 7*guiscale())
|
, m_colorPaletteContainer(options.showIndexTab ?
|
||||||
|
new ui::View: nullptr)
|
||||||
|
, m_colorPalette(options.showIndexTab ?
|
||||||
|
new PaletteView(false, PaletteView::SelectOneColor, this, 7*guiscale()):
|
||||||
|
nullptr)
|
||||||
, m_simpleColors(nullptr)
|
, m_simpleColors(nullptr)
|
||||||
, m_maskLabel("Transparent Color Selected")
|
, m_maskLabel("Transparent Color Selected")
|
||||||
, m_canPin(canPin)
|
, m_canPin(options.canPinSelector)
|
||||||
, m_disableHexUpdate(false)
|
, m_disableHexUpdate(false)
|
||||||
{
|
{
|
||||||
if (showSimpleColors) {
|
if (options.showSimpleColors) {
|
||||||
if (!g_simplePal) {
|
if (!g_simplePal) {
|
||||||
ResourceFinder rf;
|
ResourceFinder rf;
|
||||||
rf.includeDataDir("palettes/tags.gpl");
|
rf.includeDataDir("palettes/tags.gpl");
|
||||||
@ -188,11 +191,13 @@ ColorPopup::ColorPopup(const bool canPin,
|
|||||||
|
|
||||||
if (g_simplePal)
|
if (g_simplePal)
|
||||||
m_simpleColors = new SimpleColors(this, &m_tooltips);
|
m_simpleColors = new SimpleColors(this, &m_tooltips);
|
||||||
else
|
|
||||||
showSimpleColors = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_colorType.addItem("Index")->setFocusStop(false);
|
ButtonSet::Item* item = m_colorType.addItem("Index");
|
||||||
|
item->setFocusStop(false);
|
||||||
|
if (!options.showIndexTab)
|
||||||
|
item->setVisible(false);
|
||||||
|
|
||||||
m_colorType.addItem("RGB")->setFocusStop(false);
|
m_colorType.addItem("RGB")->setFocusStop(false);
|
||||||
m_colorType.addItem("HSV")->setFocusStop(false);
|
m_colorType.addItem("HSV")->setFocusStop(false);
|
||||||
m_colorType.addItem("HSL")->setFocusStop(false);
|
m_colorType.addItem("HSL")->setFocusStop(false);
|
||||||
@ -202,8 +207,10 @@ ColorPopup::ColorPopup(const bool canPin,
|
|||||||
m_topBox.setBorder(gfx::Border(0));
|
m_topBox.setBorder(gfx::Border(0));
|
||||||
m_topBox.setChildSpacing(0);
|
m_topBox.setChildSpacing(0);
|
||||||
|
|
||||||
m_colorPaletteContainer.attachToView(&m_colorPalette);
|
if (m_colorPalette) {
|
||||||
m_colorPaletteContainer.setExpansive(true);
|
m_colorPaletteContainer->attachToView(m_colorPalette);
|
||||||
|
m_colorPaletteContainer->setExpansive(true);
|
||||||
|
}
|
||||||
m_sliders.setExpansive(true);
|
m_sliders.setExpansive(true);
|
||||||
|
|
||||||
m_topBox.addChild(&m_colorType);
|
m_topBox.addChild(&m_colorType);
|
||||||
@ -235,7 +242,8 @@ ColorPopup::ColorPopup(const bool canPin,
|
|||||||
if (m_simpleColors)
|
if (m_simpleColors)
|
||||||
m_vbox.addChild(m_simpleColors);
|
m_vbox.addChild(m_simpleColors);
|
||||||
m_vbox.addChild(&m_topBox);
|
m_vbox.addChild(&m_topBox);
|
||||||
m_vbox.addChild(&m_colorPaletteContainer);
|
if (m_colorPaletteContainer)
|
||||||
|
m_vbox.addChild(m_colorPaletteContainer);
|
||||||
m_vbox.addChild(&m_sliders);
|
m_vbox.addChild(&m_sliders);
|
||||||
m_vbox.addChild(&m_maskLabel);
|
m_vbox.addChild(&m_maskLabel);
|
||||||
addChild(&m_vbox);
|
addChild(&m_vbox);
|
||||||
@ -278,8 +286,10 @@ void ColorPopup::setColor(const app::Color& color, SetColorOptions options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (color.getType() == app::Color::IndexType) {
|
if (color.getType() == app::Color::IndexType) {
|
||||||
m_colorPalette.deselect();
|
if (m_colorPalette) {
|
||||||
m_colorPalette.selectColor(color.getIndex());
|
m_colorPalette->deselect();
|
||||||
|
m_colorPalette->selectColor(color.getIndex());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sliders.setColor(m_color);
|
m_sliders.setColor(m_color);
|
||||||
@ -408,12 +418,15 @@ void ColorPopup::onColorTypeClick()
|
|||||||
|
|
||||||
void ColorPopup::onPaletteChange()
|
void ColorPopup::onPaletteChange()
|
||||||
{
|
{
|
||||||
setColor(getColor(), DoNotChangeType);
|
setColor(getColor(), DontChangeType);
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorPopup::findBestfitIndex(const app::Color& color)
|
void ColorPopup::findBestfitIndex(const app::Color& color)
|
||||||
{
|
{
|
||||||
|
if (!m_colorPalette)
|
||||||
|
return;
|
||||||
|
|
||||||
// Find bestfit palette entry
|
// Find bestfit palette entry
|
||||||
int r = color.getRed();
|
int r = color.getRed();
|
||||||
int g = color.getGreen();
|
int g = color.getGreen();
|
||||||
@ -423,8 +436,8 @@ void ColorPopup::findBestfitIndex(const app::Color& color)
|
|||||||
// Search for the closest color to the RGB values
|
// Search for the closest color to the RGB values
|
||||||
int i = get_current_palette()->findBestfit(r, g, b, a, 0);
|
int i = get_current_palette()->findBestfit(r, g, b, a, 0);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
m_colorPalette.deselect();
|
m_colorPalette->deselect();
|
||||||
m_colorPalette.selectColor(i);
|
m_colorPalette->selectColor(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,13 +451,20 @@ void ColorPopup::setColorWithSignal(const app::Color& color)
|
|||||||
|
|
||||||
void ColorPopup::selectColorType(app::Color::Type type)
|
void ColorPopup::selectColorType(app::Color::Type type)
|
||||||
{
|
{
|
||||||
m_colorPaletteContainer.setVisible(type == app::Color::IndexType);
|
if (m_colorPaletteContainer)
|
||||||
|
m_colorPaletteContainer->setVisible(type == app::Color::IndexType);
|
||||||
|
|
||||||
m_maskLabel.setVisible(type == app::Color::MaskType);
|
m_maskLabel.setVisible(type == app::Color::MaskType);
|
||||||
|
|
||||||
// Count selected items.
|
// Count selected items.
|
||||||
if (m_colorType.countSelectedItems() < 2) {
|
if (m_colorType.countSelectedItems() < 2) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case app::Color::IndexType: m_colorType.setSelectedItem(INDEX_MODE); break;
|
case app::Color::IndexType:
|
||||||
|
if (m_colorPalette)
|
||||||
|
m_colorType.setSelectedItem(INDEX_MODE);
|
||||||
|
else
|
||||||
|
m_colorType.setSelectedItem(RGB_MODE);
|
||||||
|
break;
|
||||||
case app::Color::RgbType: m_colorType.setSelectedItem(RGB_MODE); break;
|
case app::Color::RgbType: m_colorType.setSelectedItem(RGB_MODE); break;
|
||||||
case app::Color::HsvType: m_colorType.setSelectedItem(HSV_MODE); break;
|
case app::Color::HsvType: m_colorType.setSelectedItem(HSV_MODE); break;
|
||||||
case app::Color::HslType: m_colorType.setSelectedItem(HSL_MODE); break;
|
case app::Color::HslType: m_colorType.setSelectedItem(HSL_MODE); break;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "app/color.h"
|
#include "app/color.h"
|
||||||
#include "app/ui/button_set.h"
|
#include "app/ui/button_set.h"
|
||||||
|
#include "app/ui/color_button_options.h"
|
||||||
#include "app/ui/color_sliders.h"
|
#include "app/ui/color_sliders.h"
|
||||||
#include "app/ui/hex_color_entry.h"
|
#include "app/ui/hex_color_entry.h"
|
||||||
#include "app/ui/palette_view.h"
|
#include "app/ui/palette_view.h"
|
||||||
@ -29,10 +30,10 @@ namespace app {
|
|||||||
public:
|
public:
|
||||||
enum SetColorOptions {
|
enum SetColorOptions {
|
||||||
ChangeType,
|
ChangeType,
|
||||||
DoNotChangeType
|
DontChangeType
|
||||||
};
|
};
|
||||||
|
|
||||||
ColorPopup(const bool canPin, bool showSimpleColors);
|
ColorPopup(const ColorButtonOptions& options);
|
||||||
~ColorPopup();
|
~ColorPopup();
|
||||||
|
|
||||||
void setColor(const app::Color& color, SetColorOptions options);
|
void setColor(const app::Color& color, SetColorOptions options);
|
||||||
@ -71,8 +72,8 @@ namespace app {
|
|||||||
ui::TooltipManager m_tooltips;
|
ui::TooltipManager m_tooltips;
|
||||||
ui::Box m_topBox;
|
ui::Box m_topBox;
|
||||||
app::Color m_color;
|
app::Color m_color;
|
||||||
ui::View m_colorPaletteContainer;
|
ui::View* m_colorPaletteContainer;
|
||||||
PaletteView m_colorPalette;
|
PaletteView* m_colorPalette;
|
||||||
SimpleColors* m_simpleColors;
|
SimpleColors* m_simpleColors;
|
||||||
CustomButtonSet m_colorType;
|
CustomButtonSet m_colorType;
|
||||||
HexColorEntry m_hexColorEntry;
|
HexColorEntry m_hexColorEntry;
|
||||||
|
@ -928,7 +928,7 @@ class ContextBar::TransparentColorField : public HBox {
|
|||||||
public:
|
public:
|
||||||
TransparentColorField(ContextBar* owner)
|
TransparentColorField(ContextBar* owner)
|
||||||
: m_icon(1)
|
: m_icon(1)
|
||||||
, m_maskColor(app::Color::fromMask(), IMAGE_RGB, false, false)
|
, m_maskColor(app::Color::fromMask(), IMAGE_RGB, ColorButtonOptions())
|
||||||
, m_owner(owner) {
|
, m_owner(owner) {
|
||||||
SkinTheme* theme = SkinTheme::instance();
|
SkinTheme* theme = SkinTheme::instance();
|
||||||
|
|
||||||
|
@ -406,11 +406,16 @@ Widget* WidgetLoader::convertXmlElementToWidget(const TiXmlElement* elem, Widget
|
|||||||
const bool rgba = bool_attr_is_true(elem, "rgba");
|
const bool rgba = bool_attr_is_true(elem, "rgba");
|
||||||
const bool simple = bool_attr_is_true(elem, "simple");
|
const bool simple = bool_attr_is_true(elem, "simple");
|
||||||
|
|
||||||
if (!widget)
|
if (!widget) {
|
||||||
|
ColorButtonOptions options;
|
||||||
|
options.canPinSelector = false;
|
||||||
|
options.showSimpleColors = simple;
|
||||||
|
options.showIndexTab = true;
|
||||||
widget = new ColorButton(Color::fromMask(),
|
widget = new ColorButton(Color::fromMask(),
|
||||||
rgba ? IMAGE_RGB:
|
(rgba ? IMAGE_RGB:
|
||||||
app_get_current_pixel_format(), false,
|
app_get_current_pixel_format()),
|
||||||
simple);
|
options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (elem_name == "dropdownbutton") {
|
else if (elem_name == "dropdownbutton") {
|
||||||
if (!widget) {
|
if (!widget) {
|
||||||
|
Loading…
Reference in New Issue
Block a user