* \brief Constructor * @param parent as the parent widget * @param name as the object name */
| 41 | * @param name as the object name |
| 42 | */ |
| 43 | UBPageNavigationWidget::UBPageNavigationWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent) |
| 44 | , mNavigator(NULL) |
| 45 | , mLayout(NULL) |
| 46 | , mHLayout(NULL) |
| 47 | , mPageNbr(NULL) |
| 48 | , mClock(NULL) |
| 49 | { |
| 50 | setObjectName(name); |
| 51 | mName = "PageNavigator"; |
| 52 | mVisibleState = true; |
| 53 | |
| 54 | SET_STYLE_SHEET(); |
| 55 | |
| 56 | mIconToRight = QPixmap(":images/pages_open.png"); |
| 57 | mIconToLeft = QPixmap(":images/pages_close.png"); |
| 58 | |
| 59 | // Build the gui |
| 60 | mLayout = new QVBoxLayout(this); |
| 61 | setLayout(mLayout); |
| 62 | |
| 63 | mNavigator = new UBBoardThumbnailsView(this); |
| 64 | mLayout->addWidget(mNavigator, 1); |
| 65 | |
| 66 | mHLayout = new QHBoxLayout(); |
| 67 | mLayout->addLayout(mHLayout, 0); |
| 68 | |
| 69 | mPageNbr = new QLabel(this); |
| 70 | mClock = new QLabel(this); |
| 71 | mHLayout->addWidget(mPageNbr); |
| 72 | mHLayout->addWidget(mClock); |
| 73 | |
| 74 | // Configure the page number indicator |
| 75 | mPageNbr->setStyleSheet(QString("QLabel { color: white; background-color: transparent; border: none; font-family: Arial; font-weight: bold; font-size: 20px }")); |
| 76 | setPageNumber(0, 0); |
| 77 | mPageNbr->setAlignment(Qt::AlignHCenter); |
| 78 | |
| 79 | // Configure the clock |
| 80 | mClock->setStyleSheet(QString("QLabel {color: white; background-color: transparent; text-align: center; font-family: Arial; font-weight: bold; font-size: 20px}")); |
| 81 | mTimeFormat = QLocale::system().timeFormat(QLocale::ShortFormat); |
| 82 | mClock->setAlignment(Qt::AlignHCenter); |
| 83 | |
| 84 | //strip seconds |
| 85 | mTimeFormat = mTimeFormat.remove(":ss"); |
| 86 | mTimeFormat = mTimeFormat.remove(":s"); |
| 87 | mTimerID = startTimer(1000); |
| 88 | |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * \brief Destructor |