all repos — fluxbox @ b13f59e753de9b8f69c35f325afe3d3603272701

custom fork of the fluxbox windowmanager

Make arrows in buttons half the size of the button.
Add UP and DOWN arrows.
grubert grubert
commit

b13f59e753de9b8f69c35f325afe3d3603272701

parent

0583166a150d06e1281392ec65821eb06fa0a374

3 files changed, 26 insertions(+), 12 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.10: +*04/05/18: + * Make the size of arrows in buttons half the button size (grubert). + * Add UP and DOWN buttons. *04/05/17: * Fix rendering of transparency on menu exposes (Simon) - also enable save unders for menu windows
M src/ArrowButton.ccsrc/ArrowButton.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ArrowButton.cc,v 1.5 2003/10/13 23:51:04 fluxgen Exp $ +// $Id: ArrowButton.cc,v 1.6 2004/05/18 08:35:22 grubert Exp $ #include "ArrowButton.hh"

@@ -82,22 +82,32 @@ redraws the arrow button

*/ void ArrowButton::drawArrow() { XPoint pts[3]; - unsigned int w = width() / 2; - unsigned int h = height() / 2; + unsigned int w = width(); + unsigned int h = height(); + // arrow size: half of the button + unsigned int ax = w / 2; + unsigned int ay = h / 2; switch (m_arrow_type) { case LEFT: - pts[0].x = w - 2; pts[0].y = h; - pts[1].x = 4; pts[1].y = 2; - pts[2].x = 0; pts[2].y = -4; + // start at the tip + pts[0].x = (w / 2) - (ax / 2); pts[0].y = h / 2; + pts[1].x = ax; pts[1].y = ay / 2; + pts[2].x = 0; pts[2].y = - ay; break; case RIGHT: - pts[0].x = w - 2; pts[0].y = h - 2; - pts[1].x = 4; pts[1].y = 2; - pts[2].x = -4; pts[2].y = 2; + pts[0].x = (w / 2) + (ax / 2); pts[0].y = h / 2; + pts[1].x = - ax; pts[1].y = ay / 2; + pts[2].x = 0; pts[2].y = - ay; break; - case UP: // TODO + case UP: + pts[0].x = (w / 2); pts[0].y = (h / 2) - (ay / 2); + pts[1].x = ax / 2; pts[1].y = ay; + pts[2].x = - ax; pts[2].y = 0; break; - case DOWN: // TODO + case DOWN: + pts[0].x = (w / 2); pts[0].y = (h / 2) + (ay / 2); + pts[1].x = ax / 2; pts[1].y = - ay; + pts[2].x = - ax; pts[2].y = 0; break; }
M src/ToolFactory.ccsrc/ToolFactory.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolFactory.cc,v 1.3 2004/01/11 16:09:50 fluxgen Exp $ +// $Id: ToolFactory.cc,v 1.4 2004/05/18 08:35:22 grubert Exp $ #include "ToolFactory.hh"

@@ -108,6 +108,7 @@ FbTk::RefCount<FbTk::Command> cmd(CommandParser::instance().parseLine(name));

if (*cmd == 0) // we need a command return 0; + // TODO maybe direction of arrows should depend on toolbar layout ? ArrowButton::Type arrow_type = ArrowButton::LEFT; if (name == "nextworkspace") arrow_type = ArrowButton::RIGHT;