1906 {
1907 wxAutoBufferedPaintDC dc(this);
1908 const PaneColors c = PaneColors::current();
1909 const wxRect r = GetClientRect();
1910 const wxColour teal(0x00, 0x96, 0x88);
1911 const bool enabled =
usable();
1912
1913 wxColour fill = c.bg, border = c.frame, text = c.ink;
1915 fill = (
m_hover && enabled) ? wxColour(0x26, 0xa6, 0x9a) : teal;
1916 border = fill;
1917 text = *wxWHITE;
1919 fill =
mix(c.bg, teal, 0.22);
1920 border = teal;
1921 }
else if (
m_hover && enabled) {
1922 fill = c.hover;
1923 }
1925 fill =
mix(fill, teal, 0.18);
1926
1927 dc.SetBackground(wxBrush(c.bg));
1928 dc.Clear();
1929 dc.SetBrush(wxBrush(fill));
1930 dc.SetPen(wxPen(border, 1));
1931 dc.DrawRoundedRectangle(r, FromDIP(2));
1932
1933
1934
1938 }
1940 int x = 0;
1941 if (bmp.IsOk()) {
1943 x =
m_label.empty() ? (r.width - bs.x) / 2 : FromDIP(9);
1944 dc.DrawBitmap(enabled ? bmp :
faded(bmp, 0.35), x, (r.height - bs.y) / 2,
true);
1945 x += bs.x + FromDIP(6);
1946 } else {
1947 x = FromDIP(9);
1948 }
1950 dc.SetFont(GetFont());
1951 dc.SetTextForeground(enabled ? text :
mix(text, c.bg, 0.55));
1952 dc.DrawText(
m_label, x, (r.height - dc.GetTextExtent(
m_label).y) / 2);
1953 }
1955 const int d = FromDIP(9);
1956 dc.SetPen(wxPen(c.bg, FromDIP(2)));
1957 dc.SetBrush(wxBrush(wxColour(0xe0, 0xa4, 0x4a)));
1958 dc.DrawCircle(r.width - d / 2 - 1, d / 2 + 1, d / 2);
1959 }
1960 }
wxBitmap pane_icon(wxWindow *win, const std::string &name, int size_dip)
Definition UVEditorCanvas.cpp:1737
wxBitmap faded(const wxBitmap &bmp, double alpha)
Definition UVEditorCanvas.cpp:1761
wxColour mix(const wxColour &a, const wxColour &b, double t)
Definition UVEditorCanvas.cpp:1786
wxSize drawn_size(const wxBitmap &bmp)
Definition UVEditorCanvas.cpp:1751