diff --git a/data/pref.xml b/data/pref.xml
index b87b60da8..b2e4bb762 100644
--- a/data/pref.xml
+++ b/data/pref.xml
@@ -189,6 +189,7 @@
+
diff --git a/data/strings/en.ini b/data/strings/en.ini
index c4ae93340..7adfe3e5a 100644
--- a/data/strings/en.ini
+++ b/data/strings/en.ini
@@ -914,6 +914,7 @@ expand_menu_bar_items_on_mouseover_tooltip = <<
+
AfterCommandExecution.connect(&ColorBar::onAfterExecuteCommand, this);
m_fgConn = Preferences::instance().colorBar.fgColor.AfterChange.connect(base::Bind(&ColorBar::onFgColorChangeFromPreferences, this));
m_bgConn = Preferences::instance().colorBar.bgColor.AfterChange.connect(base::Bind(&ColorBar::onBgColorChangeFromPreferences, this));
+ m_sepConn = Preferences::instance().colorBar.entriesSeparator.AfterChange.connect(base::Bind(&ColorBar::invalidate, this));
m_paletteView.FocusOrClick.connect(&ColorBar::onFocusPaletteView, this);
m_appPalChangeConn = App::instance()->PaletteChange.connect(&ColorBar::onAppPaletteChange, this);
KeyboardShortcuts::instance()->UserChange.connect(
diff --git a/src/app/ui/color_bar.h b/src/app/ui/color_bar.h
index 4fca2ba77..62590a60e 100644
--- a/src/app/ui/color_bar.h
+++ b/src/app/ui/color_bar.h
@@ -1,5 +1,5 @@
// Aseprite
-// Copyright (C) 2018 Igara Studio S.A.
+// Copyright (C) 2018-2019 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@@ -191,6 +191,7 @@ namespace app {
obs::scoped_connection m_afterCmdConn;
obs::scoped_connection m_fgConn;
obs::scoped_connection m_bgConn;
+ obs::scoped_connection m_sepConn;
obs::scoped_connection m_appPalChangeConn;
ui::MouseButtons m_lastButtons;
diff --git a/src/app/ui/palette_view.cpp b/src/app/ui/palette_view.cpp
index 7ef75f9db..be95c8c80 100644
--- a/src/app/ui/palette_view.cpp
+++ b/src/app/ui/palette_view.cpp
@@ -459,10 +459,12 @@ void PaletteView::onPaint(ui::PaintEvent& ev)
int fgIndex = -1;
int bgIndex = -1;
int transparentIndex = -1;
- bool hotColor = (m_hot.part == Hit::COLOR ||
- m_hot.part == Hit::POSSIBLE_COLOR);
- bool dragging = (m_state == State::DRAGGING_OUTLINE && hotColor);
- bool resizing = (m_state == State::RESIZING_PALETTE && hotColor);
+ const bool hotColor = (m_hot.part == Hit::COLOR ||
+ m_hot.part == Hit::POSSIBLE_COLOR);
+ const bool dragging = (m_state == State::DRAGGING_OUTLINE && hotColor);
+ const bool resizing = (m_state == State::RESIZING_PALETTE && hotColor);
+ const bool withSeparator =
+ Preferences::instance().colorBar.entriesSeparator();
if (m_style == FgBgColors && m_delegate) {
fgIndex = findExactIndex(m_delegate->onPaletteViewGetForegroundIndex());
@@ -495,7 +497,7 @@ void PaletteView::onPaint(ui::PaintEvent& ev)
}
gfx::Rect box = getPaletteEntryBounds(i + boxOffset);
- gfx::Color gfxColor = drawEntry(g, box, i + idxOffset);
+ gfx::Color gfxColor = drawEntry(g, box, i + idxOffset, withSeparator);
const int boxsize = int(m_boxsize * guiscale());
switch (m_style) {
@@ -564,7 +566,7 @@ void PaletteView::onPaint(ui::PaintEvent& ev)
// Draw color being dragged + label
if (dragging) {
gfx::Rect box2 = getPaletteEntryBounds(k);
- gfx::Color gfxColor = drawEntry(g, box2, i); // Draw color entry
+ gfx::Color gfxColor = drawEntry(g, box2, i, withSeparator); // Draw color entry
gfx::Color neg = color_utils::blackandwhite_neg(gfxColor);
os::Font* minifont = theme->getMiniFont();
@@ -1014,7 +1016,10 @@ void PaletteView::setNewPalette(doc::Palette* oldPalette,
manager()->invalidate();
}
-gfx::Color PaletteView::drawEntry(ui::Graphics* g, const gfx::Rect& box, int palIdx)
+gfx::Color PaletteView::drawEntry(ui::Graphics* g,
+ const gfx::Rect& box,
+ const int palIdx,
+ const bool withSeparator)
{
doc::color_t palColor =
(palIdx < currentPalette()->size() ? currentPalette()->getEntry(palIdx):
@@ -1031,10 +1036,12 @@ gfx::Color PaletteView::drawEntry(ui::Graphics* g, const gfx::Rect& box, int pal
rgba_geta(palColor));
gfx::Rect box2(box);
- box2.enlarge(1);
- for (int i=1; i<=guiscale(); ++i, box2.enlarge(1))
- g->drawRect(gfx::rgba(0, 0, 0), box2);
- draw_color(g, box, appColor, doc::ColorMode::RGB);
+ box2.enlarge(guiscale());
+ if (withSeparator) {
+ for (int i=0; idrawRect(gfx::rgba(0, 0, 0), box2);
+ }
+ draw_color(g, box2, appColor, doc::ColorMode::RGB);
return gfxColor;
}
diff --git a/src/app/ui/palette_view.h b/src/app/ui/palette_view.h
index 4a3643b19..3bf4a3e62 100644
--- a/src/app/ui/palette_view.h
+++ b/src/app/ui/palette_view.h
@@ -141,7 +141,10 @@ namespace app {
int findExactIndex(const app::Color& color) const;
void setNewPalette(doc::Palette* oldPalette, doc::Palette* newPalette,
PaletteViewModification mod);
- gfx::Color drawEntry(ui::Graphics* g, const gfx::Rect& box, int palIdx);
+ gfx::Color drawEntry(ui::Graphics* g,
+ const gfx::Rect& box,
+ const int palIdx,
+ const bool withSeparator);
State m_state;
bool m_editable;