Commit 96f6becd authored by Frédéric Brière's avatar Frédéric Brière
Browse files

radselect: Let RadicalButton inherit its font from its parent

RadicalButton::setStatus() no longer has any reason to call setFont(),
so it can simply inherit its font from its ButtonGrid parent, which can
also stop overriding its own setFont() and let Qt do the dirty work.
parent 5bea502c
......@@ -122,14 +122,6 @@ void ButtonGrid::radicalClicked( const QString &newrad
}
}
void ButtonGrid::setFont( const QFont &font )
{
foreach( QPushButton *button, m_buttons )
{
button->setFont( font );
}
}
void ButtonGrid::updateButtons()
{
if ( ! m_radicalInfo )
......
......@@ -47,7 +47,6 @@ class ButtonGrid : public QWidget
* Reset all buttons to the up and uncolored state
*/
void clearSelections();
void setFont( const QFont &font );
private:
void buildRadicalButtons();
......
......@@ -92,8 +92,6 @@ void RadicalButton::setStatus( RadicalButton::ButtonStatus newStatus )
//Because it's more work to check everything rather than just set it,
//we'll just set everything every time
bool checked = false,
underline = false,
italic = false,
hidden = false,
disabled = false;
switch( newStatus )
......@@ -112,10 +110,6 @@ void RadicalButton::setStatus( RadicalButton::ButtonStatus newStatus )
hidden = true;
}
QFont theFont = font();
theFont.setUnderline( underline );
theFont.setItalic( italic );
setFont( theFont );
setVisible( ! hidden );
setEnabled( ! disabled );
setChecked( checked );
......
......@@ -30,7 +30,7 @@ class RadicalButton : public QPushButton
typedef enum
{
Normal, /**< Normal button */
Selected, /**< This button has been selected: bold + underline */
Selected, /**< This button has been selected (checked) */
NotAppropriate, /**< Due to other selected buttons: disabled */
Related, /**< Display only this radical and related ones: italics? */
Hidden /**< Not related (to above), so hide() */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment