Commit cb693241 authored by Pino Toscano's avatar Pino Toscano

Accessibility configuration "refactory", part #2:

make the group containing the "change colors" information shrink to the minimum size (depending on the configuration widget chosen)

svn path=/trunk/KDE/kdegraphics/okular/; revision=712179
parent 5fe50823
......@@ -12,8 +12,33 @@
#include "ui_dlgaccessibilitybase.h"
DlgAccessibility::DlgAccessibility( QWidget * parent )
: QWidget( parent )
: QWidget( parent ), m_selected( 0 )
{
Ui_DlgAccessibilityBase dlg;
dlg.setupUi( this );
m_dlg = new Ui_DlgAccessibilityBase();
m_dlg->setupUi( this );
m_color_pages.append( m_dlg->page_invert );
m_color_pages.append( m_dlg->page_paperColor );
m_color_pages.append( m_dlg->page_darkLight );
m_color_pages.append( m_dlg->page_bw );
foreach ( QWidget * page, m_color_pages )
page->hide();
m_color_pages[ m_selected ]->show();
connect( m_dlg->kcfg_RenderMode, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotColorMode( int ) ) );
}
DlgAccessibility::~DlgAccessibility()
{
delete m_dlg;
}
void DlgAccessibility::slotColorMode( int mode )
{
m_color_pages[ m_selected ]->hide();
m_color_pages[ mode ]->show();
m_selected = mode;
}
#include "dlgaccessibility.moc"
......@@ -10,12 +10,26 @@
#ifndef _DLGACCESSIBILITY_H
#define _DLGACCESSIBILITY_H
#include <qlist.h>
#include <qwidget.h>
class Ui_DlgAccessibilityBase;
class DlgAccessibility : public QWidget
{
Q_OBJECT
public:
DlgAccessibility( QWidget * parent = 0 );
~DlgAccessibility();
private slots:
void slotColorMode( int mode );
private:
Ui_DlgAccessibilityBase * m_dlg;
QList< QWidget * > m_color_pages;
int m_selected;
};
#endif
This diff is collapsed.
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