Esempio n. 1
0
UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):UBDockPalette(parent)
  , mpPageNavigator(NULL)
{
    setObjectName(name);
    setOrientation(eUBDockOrientation_Left);
    mLastWidth = 300;
    setMaximumWidth(300);
    resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), height());

    mpLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin());

    mpPageNavigator = new UBPageNavigationWidget(this);
    addTabWidget(mpPageNavigator);
}
Esempio n. 2
0
UBRightPalette::UBRightPalette(QWidget *parent, const char *name):UBDockPalette(parent)
  , mpLibWidget(NULL)
{
    setObjectName(name);
    setOrientation(eUBDockOrientation_Right);
    setOrientation(eUBDockOrientation_Right);
    mCollapseWidth = 180;
    mLastWidth = 300;
    resize(UBSettings::settings()->libPaletteWidth->get().toInt(), parentWidget()->height());
    mpLayout->setContentsMargins(2*border() + customMargin(), customMargin(), customMargin(), customMargin());

    mpLibWidget = new UBLibWidget(this);
    addTabWidget(mpLibWidget);
}
Esempio n. 3
0
/**
 * \brief Constructor
 * @param parent as the parent widget
 * @param name as the object name
 */
UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name):
	UBDockPalette(eUBDockPaletteType_LEFT, parent, name)
	, mNavigator(NULL)
	, mLayout(NULL)
    , mHLayout(NULL)
    , mPageNbr(NULL)
    , mClock(NULL)
{
    // Build the gui
    mLayout = new QVBoxLayout(this);
    mLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin());
    setLayout(mLayout);

    mNavigator = new UBDocumentNavigator(this);
    mNavigator->setStyleSheet(QString("background-color : transparent;"));
    mLayout->addWidget(mNavigator, 1);

    mHLayout = new QHBoxLayout();
    mLayout->addLayout(mHLayout, 0);

    mPageNbr = new QLabel(this);
    mClock = new QLabel(this);
    mHLayout->addWidget(mPageNbr);
    mHLayout->addWidget(mClock);

    // Configure the page number indicator
    mPageNbr->setStyleSheet(QString("QLabel { color: white; background-color: transparent; border: none; font-family: Arial; font-weight: bold; font-size: 20px }"));
    setPageNumber(0, 0);
    mPageNbr->setAlignment(Qt::AlignHCenter);

    // Configure the clock
    mClock->setStyleSheet(QString("QLabel {color: white; background-color: transparent; text-align: center; font-family: Arial; font-weight: bold; font-size: 20px}"));
    mTimeFormat = QLocale::system().timeFormat(QLocale::ShortFormat);
    mClock->setAlignment(Qt::AlignHCenter);

    //strip seconds
    mTimeFormat = mTimeFormat.remove(":ss");
    mTimeFormat = mTimeFormat.remove(":s");
    mTimerID = startTimer(1000);

}