Ejemplo n.º 1
0
	colour style::foreground_colour() const
	{
		if (has_foreground_colour())
			return *iForegroundColour;
		else
			return colour().light() ? colour().darker(0x20) : colour().lighter(0x20);
	}
Ejemplo n.º 2
0
	void toolbar_button::paint(graphics_context& aGraphicsContext) const
	{
		if (!iAction.is_separator())
			push_button::paint(aGraphicsContext);
		else
		{
			scoped_units su(*this, aGraphicsContext, UnitsPixels);
			rect line = client_rect();
			line.deflate(0, std::floor(client_rect().height() / 6.0));
			line.cx = 1.0;
			colour ink = (has_foreground_colour() ? foreground_colour() : app::instance().current_style().foreground_colour());
			aGraphicsContext.fill_rect(line, ink.darker(0x40));
			++line.x;
			aGraphicsContext.fill_rect(line, ink.lighter(0x40));
		}
	}