minor fix for title and item height
This commit is contained in:
parent
825c02ccb0
commit
05a1b55901
2 changed files with 15 additions and 11 deletions
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: MenuTheme.cc,v 1.16 2004/06/07 21:02:49 fluxgen Exp $
|
// $Id: MenuTheme.cc,v 1.17 2004/06/13 10:59:54 fluxgen Exp $
|
||||||
|
|
||||||
#include "MenuTheme.hh"
|
#include "MenuTheme.hh"
|
||||||
|
|
||||||
|
@ -66,9 +66,10 @@ MenuTheme::MenuTheme(int screen_num):
|
||||||
m_alpha(255),
|
m_alpha(255),
|
||||||
m_menumode(DELAY_OPEN),
|
m_menumode(DELAY_OPEN),
|
||||||
m_delayopen(0), // no delay as default
|
m_delayopen(0), // no delay as default
|
||||||
m_delayclose(0) // no delay as default
|
m_delayclose(0), // no delay as default
|
||||||
|
m_real_title_height(*m_title_height),
|
||||||
|
m_real_item_height(*m_item_height)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set default values
|
// set default values
|
||||||
*m_border_width = 0;
|
*m_border_width = 0;
|
||||||
*m_bevel_width = 0;
|
*m_bevel_width = 0;
|
||||||
|
@ -93,11 +94,13 @@ void MenuTheme::reconfigTheme() {
|
||||||
if (*m_border_width > 20)
|
if (*m_border_width > 20)
|
||||||
*m_border_width = 20;
|
*m_border_width = 20;
|
||||||
|
|
||||||
int item_height = std::max(itemHeight(), frameFont().height() + bevelWidth());
|
m_real_item_height = std::max(*m_item_height, frameFont().height() + 2*bevelWidth());
|
||||||
|
m_real_title_height = std::max(*m_title_height,
|
||||||
|
titleFont().height() + 2*bevelWidth());
|
||||||
|
|
||||||
m_bullet_pixmap->scale(item_height, item_height);
|
m_bullet_pixmap->scale(itemHeight(), itemHeight());
|
||||||
m_selected_pixmap->scale(item_height, item_height);
|
m_selected_pixmap->scale(itemHeight(), itemHeight());
|
||||||
m_unselected_pixmap->scale(item_height, item_height);
|
m_unselected_pixmap->scale(itemHeight(), itemHeight());
|
||||||
|
|
||||||
t_text_gc.setForeground(*t_text);
|
t_text_gc.setForeground(*t_text);
|
||||||
f_text_gc.setForeground(*f_text);
|
f_text_gc.setForeground(*f_text);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: MenuTheme.hh,v 1.15 2004/06/13 00:33:06 fluxgen Exp $
|
// $Id: MenuTheme.hh,v 1.16 2004/06/13 10:59:24 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef FBTK_MENUTHEME_HH
|
#ifndef FBTK_MENUTHEME_HH
|
||||||
#define FBTK_MENUTHEME_HH
|
#define FBTK_MENUTHEME_HH
|
||||||
|
@ -102,8 +102,8 @@ public:
|
||||||
inline BulletType bullet() const { return *m_bullet; }
|
inline BulletType bullet() const { return *m_bullet; }
|
||||||
inline FbTk::Justify bulletPos() const { return *bullet_pos; }
|
inline FbTk::Justify bulletPos() const { return *bullet_pos; }
|
||||||
|
|
||||||
inline unsigned int titleHeight() const { return *m_title_height; }
|
inline unsigned int titleHeight() const { return m_real_title_height; }
|
||||||
inline unsigned int itemHeight() const { return *m_item_height; }
|
inline unsigned int itemHeight() const { return m_real_item_height; }
|
||||||
inline unsigned int borderWidth() const { return *m_border_width; }
|
inline unsigned int borderWidth() const { return *m_border_width; }
|
||||||
inline unsigned int bevelWidth() const { return *m_bevel_width; }
|
inline unsigned int bevelWidth() const { return *m_bevel_width; }
|
||||||
|
|
||||||
|
@ -141,7 +141,8 @@ private:
|
||||||
MenuMode m_menumode;
|
MenuMode m_menumode;
|
||||||
unsigned int m_delayopen; ///< in msec
|
unsigned int m_delayopen; ///< in msec
|
||||||
unsigned int m_delayclose; ///< in msec
|
unsigned int m_delayclose; ///< in msec
|
||||||
|
int m_real_title_height; ///< the calculated item height (from font and menu.titleHeight)
|
||||||
|
int m_real_item_height; ///< the calculated item height (from font and menu.itemHeight)
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace FbTk
|
} // end namespace FbTk
|
||||||
|
|
Loading…
Reference in a new issue