aMainLayout->setContentsMargins(0, 2, 2, 0);
aMainLayout->setSpacing(2);
setLayout(aMainLayout);
- setFixedHeight(menuHeight());
+ updateFromResources();
}
XGUI_MainMenu::~XGUI_MainMenu(void)
int XGUI_MainMenu::menuItemSize() const
{
const int kDefaultItemSize = 25;
- int anItemSize = XGUI_Preferences::resourceMgr()->integerValue(
- XGUI_Preferences::MENU_SECTION, "item_size", kDefaultItemSize);
- return anItemSize;
+ return kDefaultItemSize;
}
int XGUI_MainMenu::menuHeight() const
{
// Default group has no tabs above --> one extra row
int rows = menuItemRowsCount() + 1;
- const int kMarginsSpacings = 4;
+ const int kMarginsSpacings = 5;
return rows * menuItemSize() + kMarginsSpacings;
}
void XGUI_MainMenu::updateFromResources()
{
+ setFixedHeight(menuHeight());
+ repaint();
}
int aMenuTab = myPreferences->addItem(tr("Main menu"), thePageId );
int aSizeGroup = myPreferences->addItem(tr("Size"), aMenuTab );
- myPreferences->setItemProperty( "columns", 2, aSizeGroup );
-
- int aItemSizeItem = myPreferences->addItem( tr( "Item size" ),
- aSizeGroup,
- SUIT_PreferenceMgr::Selector,
- XGUI_Preferences::MENU_SECTION,
- "item_size" );
- QStringList aValuesList;
- QList<QVariant> anIndicesList;
- aValuesList << tr("Small") << tr("Medium") << tr("Large");
- anIndicesList << 20 << 25 << 30;
- myPreferences->setItemProperty( "strings", aValuesList, aItemSizeItem );
- myPreferences->setItemProperty( "indexes", anIndicesList, aItemSizeItem );
+ myPreferences->setItemProperty( "columns", 1, aSizeGroup );
int aRowsNb = myPreferences->addItem( tr( "Number of rows" ),
aSizeGroup,
XGUI_Preferences::MENU_SECTION,
"rows_number" );
myPreferences->setItemProperty( "min", 1, aRowsNb );
- myPreferences->setItemProperty( "max", 10, aRowsNb );
+ myPreferences->setItemProperty( "max", 6, aRowsNb );
}