From b282b9018e5657ceda73f8714886950c9992b46b Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 4 Jan 2005 13:13:42 +0000 Subject: [PATCH] Implemented separator style 2, courtesy of Olivier Milla git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10584 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/SeparatorItem.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/SeparatorItem.cpp b/src/kits/interface/SeparatorItem.cpp index 9ee65bc875..18cd5219e9 100644 --- a/src/kits/interface/SeparatorItem.cpp +++ b/src/kits/interface/SeparatorItem.cpp @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2004, Haiku, Inc. +// Copyright (c) 2001-2005 Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -28,8 +28,6 @@ //------------------------------------------------------------------------------ #include -#include - BSeparatorItem::BSeparatorItem() : BMenuItem(NULL, NULL, 0, 0) @@ -91,7 +89,6 @@ BSeparatorItem::Draw() BRect bounds = Frame(); - // TODO: Calling this on every Draw() doesn't seem nice. menu_info menuInfo; get_menu_info(&menuInfo); switch (menuInfo.separator) { @@ -121,9 +118,21 @@ BSeparatorItem::Draw() menu->SetHighColor(0, 0, 0); break; - case 2: // TODO: Implement "type 2" look + case 2: + menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), + B_DARKEN_2_TINT)); + menu->StrokeLine(BPoint(bounds.left + 9.0f, bounds.top + 4.0f), + BPoint(bounds.right - 9.0f, bounds.top + 4.0f)); + menu->StrokeLine(BPoint(bounds.left + 10.0f, bounds.top + 5.0f), + BPoint(bounds.right - 10.0f, bounds.top + 5.0f)); + menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), + B_LIGHTEN_2_TINT)); + menu->StrokeLine(BPoint(bounds.left + 11.0f, bounds.top + 6.0f), + BPoint(bounds.right - 11.0f, bounds.top + 6.0f)); + menu->SetHighColor(0, 0, 0); + break; + default: - printf("BSeparatorItem::Draw(): Separator item look not supported yet\n"); break; } }