fixed menu bullet and clearWindow
fluxgen fluxgen
1 files changed,
14 insertions(+),
9 deletions(-)
jump to
M
src/FbTk/Menu.cc
→
src/FbTk/Menu.cc
@@ -22,7 +22,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: Menu.cc,v 1.10 2003/02/16 15:03:22 fluxgen Exp $ +// $Id: Menu.cc,v 1.11 2003/02/23 01:00:02 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE@@ -328,7 +328,6 @@
if (tmp) m_image_ctrl.removeImage(tmp); - menu.title.clear(); } tmp = menu.frame_pixmap;@@ -375,9 +374,7 @@ }
menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + menu.title.borderWidth()*2 : 0), menu.window.width(), menu.frame_h); - menu.window.clear(); - menu.title.clear(); - menu.frame.clear(); + clearWindow(); if (title_vis && visible) redrawTitle();@@ -424,6 +421,11 @@ } else
internal_hide(); } +void Menu::clearWindow() { + menu.window.clear(); + menu.title.clear(); + menu.frame.clear(); +} void Menu::internal_hide() { if (which_sub >= 0) {@@ -670,7 +672,8 @@
if (dosel && item->isSelected() && (menu.sel_pixmap != ParentRelative)) { if (menu.sel_pixmap) { - XCopyArea(m_display, highlight ? menu.frame_pixmap : menu.sel_pixmap, menu.frame.window(), + XCopyArea(m_display, + highlight ? menu.frame_pixmap : menu.sel_pixmap, menu.frame.window(), m_theme.hiliteGC(), 0, 0, half_w, half_w, sel_x, sel_y); } else {@@ -692,11 +695,11 @@ }
if (dosel && item->submenu()) { switch (m_theme.bullet()) { - case SQUARE: + case MenuTheme::SQUARE: XDrawRectangle(m_display, menu.frame.window(), gc, sel_x, sel_y, half_w, half_w); break; - case TRIANGLE: + case MenuTheme::TRIANGLE: XPoint tri[3]; if (m_theme.bulletPos() == FbTk::RIGHT) {@@ -719,7 +722,7 @@ XFillPolygon(m_display, menu.frame.window(), gc, tri, 3, Convex,
CoordModePrevious); break; - case DIAMOND: + case MenuTheme::DIAMOND: XPoint dia[4]; dia[0].x = sel_x + quarter_w - 3;@@ -733,6 +736,8 @@ dia[3].y = 3;
XFillPolygon(m_display, menu.frame.window(), gc, dia, 4, Convex, CoordModePrevious); + break; + default: break; } }