KDE

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • KMenu question

    8 answers - 944 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello,
    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting a menu
    item with no associated action, which is visually distinct from normal menu
    items (centered text, and different BG color). In KStars, we use these menu
    titles to provide some information about an object when the user right-clicks
    in the map.
    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items with
    setEnabled(false), making them appear with greyed-out text. This doesn't
    look right; titles shouldn't look like disabled menu items.
    Does anyone know if there is a plan to add real title items to KMenu, as we
    had for KPopupMenu in KDE-3.x? If not, is there interest in having this
    functionality in KMenu (I am willing to give it a shot), or should I just
    make my own custom menu class for KStars?
    thanks,
    Jason
  • No.1 | | 1268 bytes | |

    A Dissabte 11 M 2006 23:26, Jason Harris va escriure:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting a
    menu item with no associated action, which is visually distinct from normal
    menu items (centered text, and different BG color). In KStars, we use
    these menu titles to provide some information about an object when the user
    right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items with
    setEnabled(false), making them appear with greyed-out text. This doesn't
    look right; titles shouldn't look like disabled menu items.

    Does anyone know if there is a plan to add real title items to KMenu, as we
    had for KPopupMenu in KDE-3.x? If not, is there interest in having this
    functionality in KMenu (I am willing to give it a shot), or should I just
    make my own custom menu class for KStars?

    I think it's worth to have on kdelibs.

    Albert

    thanks,
    Jason

    LLama Gratis a cualquier PC del Mundo.
    Llamadas a fijos y desde 1 por minuto.
    http://es.voice.yahoo.com

    >Visit #unsub to unsubscribe <<
  • No.2 | | 1716 bytes | |

    A Diumenge 12 M 2006 00:22, Albert Astals Cid va escriure:
    A Dissabte 11 M 2006 23:26, Jason Harris va escriure:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting a
    menu item with no associated action, which is visually distinct from
    normal menu items (centered text, and different BG color). In KStars, we
    use these menu titles to provide some information about an object when
    the user right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items with
    setEnabled(false), making them appear with greyed-out text. This doesn't
    look right; titles shouldn't look like disabled menu items.

    Does anyone know if there is a plan to add real title items to KMenu, as
    we had for KPopupMenu in KDE-3.x? If not, is there interest in having
    this functionality in KMenu (I am willing to give it a shot), or should I
    just make my own custom menu class for KStars?

    I think it's worth to have on kdelibs.

    Now in a second thought, maybe that appearance is [K|Q]Style controlled and
    you only have to bribe Qt/KDE style creators to make it look more like you
    want?

    Albert

    Albert

    thanks,
    Jason

    LLama Gratis a cualquier PC del Mundo.
    Llamadas a fijos y desde 1 por minuto.
    http://es.voice.yahoo.com
    >
    >Visit #unsub to
    >unsubscribe <<


    LLama Gratis a cualquier PC del Mundo.
    Llamadas a fijos y desde 1 por minuto.
    http://es.voice.yahoo.com

    >Visit #unsub to unsubscribe <<
  • No.3 | | 1577 bytes | |

    Sunday 12 March 2006 09:26, Jason Harris wrote:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting a
    menu item with no associated action, which is visually distinct from normal
    menu items (centered text, and different BG color). In KStars, we use
    these menu titles to provide some information about an object when the user
    right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items with
    setEnabled(false), making them appear with greyed-out text. This doesn't
    look right; titles shouldn't look like disabled menu items.

    Does anyone know if there is a plan to add real title items to KMenu, as we
    had for KPopupMenu in KDE-3.x? If not, is there interest in having this
    functionality in KMenu (I am willing to give it a shot), or should I just
    make my own custom menu class for KStars?

    Qt no longer provides the same mechanism as before to create titles (you can't
    insert a widget into a QMenu). So, I think the options are to hack the style
    to recognise a title action and draw it appropriately, or add the ability to
    have titles to Qt. I'm not sure about the best way, perhaps someone who
    knows the style system well can comment

    Cheers,
    Hamish.


    >Visit #unsub to unsubscribe <<


    PGP SIGNATURE
    Version: GnuPG v1.4.2 (GNU/Linux)

    XmgLvGspE7ic036GbkgpI=
    =637H
    PGP SIGNATURE
  • No.4 | | 2236 bytes | |

    Sunday 12 March 2006 01:00, Hamish Rodda wrote:
    Sunday 12 March 2006 09:26, Jason Harris wrote:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting a
    menu item with no associated action, which is visually distinct from
    normal menu items (centered text, and different BG color). In KStars, we
    use these menu titles to provide some information about an object when
    the user right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items with
    setEnabled(false), making them appear with greyed-out text. This doesn't
    look right; titles shouldn't look like disabled menu items.

    Does anyone know if there is a plan to add real title items to KMenu, as
    we had for KPopupMenu in KDE-3.x? If not, is there interest in having
    this functionality in KMenu (I am willing to give it a shot), or should I
    just make my own custom menu class for KStars?

    Qt no longer provides the same mechanism as before to create titles (you
    can't insert a widget into a QMenu). So, I think the options are to hack
    the style to recognise a title action and draw it appropriately,

    As it is now, I see no way for a QStyle to differentiate a header from a
    normal disabled menu item.

    or add the
    ability to have titles to Qt. I'm not sure about the best way, perhaps
    someone who knows the style system well can comment

    I don't know how extensible QMenu is. But yes, it seems to me that it should
    be added at Qt level (in case it has been decided that it's worth it, green
    light from the HCI-department, etc.).
    QSMenuItem::MenuItemType already contains various menu item types
    where an entry for headers would fit quite well. Something similar to
    QMenu::addSeparator() in Q/KMenu would then have the effect that the correct
    style option would be set and that care is taken of painting.

    Sandro


    >Visit #unsub to unsubscribe <<


    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)

    SwhQ9UAN2zPmss4QtboPIkk=
    =I7Ph
    PGP SIGNATURE
  • No.5 | | 1881 bytes | |

    Monday 13 March 2006 01:46, Sandro Giessl wrote:
    Sunday 12 March 2006 01:00, Hamish Rodda wrote:
    Sunday 12 March 2006 09:26, Jason Harris wrote:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting a
    menu item with no associated action, which is visually distinct from
    normal menu items (centered text, and different BG color). In KStars,
    we use these menu titles to provide some information about an object
    when the user right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items
    with setEnabled(false), making them appear with greyed-out text. This
    doesn't look right; titles shouldn't look like disabled menu items.

    Does anyone know if there is a plan to add real title items to KMenu,
    as we had for KPopupMenu in KDE-3.x? If not, is there interest in
    having this functionality in KMenu (I am willing to give it a shot), or
    should I just make my own custom menu class for KStars?

    Qt no longer provides the same mechanism as before to create titles (you
    can't insert a widget into a QMenu). So, I think the options are to hack
    the style to recognise a title action and draw it appropriately,

    As it is now, I see no way for a QStyle to differentiate a header from a
    normal disabled menu item.

    I was thinking something like a {Q|K}HeaderAction, which QStyle could detect
    by trying to qobject_cast. It's a slow and unclean solution however; the
    better way would be to add isHeader() and setHeader() to QAction.

    Cheers,
    Hamish.


    >Visit #unsub to unsubscribe <<


    PGP SIGNATURE
    Version: GnuPG v1.4.2 (GNU/Linux)

    W00HfdqYrwFuXDkEhr8p0W4=
    =iZSo
    PGP SIGNATURE
  • No.6 | | 2315 bytes | |

    Sunday 12 March 2006 16:00, Hamish Rodda wrote:
    Monday 13 March 2006 01:46, Sandro Giessl wrote:
    Sunday 12 March 2006 01:00, Hamish Rodda wrote:
    Sunday 12 March 2006 09:26, Jason Harris wrote:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for inserting
    a menu item with no associated action, which is visually distinct
    from normal menu items (centered text, and different BG color). In
    KStars, we use these menu titles to provide some information about an
    object when the user right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items
    with setEnabled(false), making them appear with greyed-out text.
    This doesn't look right; titles shouldn't look like disabled menu
    items.

    Does anyone know if there is a plan to add real title items to KMenu,
    as we had for KPopupMenu in KDE-3.x? If not, is there interest in
    having this functionality in KMenu (I am willing to give it a shot),
    or should I just make my own custom menu class for KStars?

    Qt no longer provides the same mechanism as before to create titles
    (you can't insert a widget into a QMenu). So, I think the options are
    to hack the style to recognise a title action and draw it
    appropriately,

    As it is now, I see no way for a QStyle to differentiate a header from a
    normal disabled menu item.

    I was thinking something like a {Q|K}HeaderAction, which QStyle could
    detect by trying to qobject_cast. It's a slow and unclean solution
    however; the better way would be to add isHeader() and setHeader() to
    QAction.

    The action isn't passed to the style when a menu item is painted in
    QStyle::drawControl(): #drawControl

    At the very best, the widget could be accessed. And the preferred way to pass
    style hints is QS (so that styles can be used independently from
    some specific widget class).
    Both ways can't be used for header detection - or am I missing something?

    Sandro


    >Visit #unsub to unsubscribe <<


    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)

    XJKR9XUun1kTPc3pvp8Hh2o=
    =SVp6
    PGP SIGNATURE
  • No.7 | | 2784 bytes | |

    Monday 13 March 2006 02:25, Sandro Giessl wrote:
    Sunday 12 March 2006 16:00, Hamish Rodda wrote:
    Monday 13 March 2006 01:46, Sandro Giessl wrote:
    Sunday 12 March 2006 01:00, Hamish Rodda wrote:
    Sunday 12 March 2006 09:26, Jason Harris wrote:
    Hello,

    In KDE-3.x, we had a function KPopupMenu::insertTitle() for
    inserting a menu item with no associated action, which is visually
    distinct from normal menu items (centered text, and different BG
    color). In KStars, we use these menu titles to provide some
    information about an object when the user right-clicks in the map.

    This functionality no longer exists in KDE-4.x. Instead we have
    KMenu::addTitle(), but the items added are simply normal menu items
    with setEnabled(false), making them appear with greyed-out text.
    This doesn't look right; titles shouldn't look like disabled menu
    items.

    Does anyone know if there is a plan to add real title items to
    KMenu, as we had for KPopupMenu in KDE-3.x? If not, is there
    interest in having this functionality in KMenu (I am willing to
    give it a shot), or should I just make my own custom menu class for
    KStars?

    Qt no longer provides the same mechanism as before to create titles
    (you can't insert a widget into a QMenu). So, I think the options
    are to hack the style to recognise a title action and draw it
    appropriately,

    As it is now, I see no way for a QStyle to differentiate a header from
    a normal disabled menu item.

    I was thinking something like a {Q|K}HeaderAction, which QStyle could
    detect by trying to qobject_cast. It's a slow and unclean solution
    however; the better way would be to add isHeader() and setHeader() to
    QAction.

    The action isn't passed to the style when a menu item is painted in
    QStyle::drawControl(): #drawControl

    At the very best, the widget could be accessed. And the preferred way to
    pass style hints is QS (so that styles can be used independently
    from some specific widget class).
    Both ways can't be used for header detection - or am I missing something?

    Ah, this is why I needed input from those who know QStyle :) Still, from the
    library user point of view, a setHeader() in QAction would be a good start to
    getting the info to QMenu. From QMenu to QStyle, i guess QS is the
    way to go.

    (note: QMenu::addSeparator() simply adds a QAction with setSeparator() called
    on it)

    I think an email to tt is in order volunteers, anyone?

    Cheers,
    Hamish.


    >Visit #unsub to unsubscribe <<


    PGP SIGNATURE
    Version: GnuPG v1.4.2 (GNU/Linux)

    H8JK/kS2t17tQVmtFVk=
    =tNj0
    PGP SIGNATURE
  • No.8 | | 348 bytes | |

    Saturday 11 March 2006 16:36, Albert Astals Cid wrote:
    Now in a second thought, maybe that appearance is [K|Q]Style controlled and
    you only have to bribe Qt/KDE style creators to make it look more like you
    want?

    No, if you look at KMenu::adTitle(), it just adds a QAction without a slot and
    calls setEnabled(false).

    Jason

Re: KMenu question


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "KDE"

EMSDN.COM