Exemplo n.º 1
0
UBWebToolsPalette::UBWebToolsPalette(QWidget *parent,bool tutorialMode=false)
    : UBActionPalette(Qt::TopRightCorner, parent)
{
    QList<QAction*> actions;
    if (tutorialMode){
        actions << UBApplication::mainWindow->actionBoard;
    }
    else{
        actions << UBApplication::mainWindow->actionWebTrapFlash;
        //actions << UBApplication::mainWindow->actionWebTrap;

        actions << UBApplication::mainWindow->actionWebCustomCapture;
        actions << UBApplication::mainWindow->actionWebWindowCapture;
        actions << UBApplication::mainWindow->actionWebOEmbed;

        //actions << UBApplication::mainWindow->actionEduMedia;

        actions << UBApplication::mainWindow->actionWebShowHideOnDisplay;

        if (UBPlatformUtils::hasVirtualKeyboard())
        {
            actions << UBApplication::mainWindow->actionVirtualKeyboard;
        }
    }
    setActions(actions);
    setButtonIconSize(QSize(42, 42));
    adjustSizeAndPosition();
}
Exemplo n.º 2
0
UBDesktopPalette::UBDesktopPalette(QWidget *parent)
    : UBActionPalette(Qt::TopLeftCorner, parent)
        , mShowHideAction(0)
        , mDisplaySelectAction(0)
{
    QList<QAction*> actions;

    mActionUniboard = new QAction(QIcon(":/images/toolbar/board.png"), tr("Show Uniboard"), this);
    connect(mActionUniboard, SIGNAL(triggered()), this, SIGNAL(uniboardClick()));
    actions << mActionUniboard;


    actions << UBApplication::mainWindow->actionPen;
    actions << UBApplication::mainWindow->actionEraser;
    actions << UBApplication::mainWindow->actionMarker;
#ifndef Q_WS_X11
    actions << UBApplication::mainWindow->actionSelector;
#endif
    actions << UBApplication::mainWindow->actionPointer;


    if (UBPlatformUtils::hasVirtualKeyboard())
    {
        actions << UBApplication::mainWindow->actionVirtualKeyboard;
        connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(toggled(bool)), this, SIGNAL(showVirtualKeyboard(bool)));
    }

    mActionCustomSelect = new QAction(QIcon(":/images/toolbar/captureArea.png"), tr("Capture Part of the Screen"), this);
    connect(mActionCustomSelect, SIGNAL(triggered()), this, SIGNAL(customClick()));
    actions << mActionCustomSelect;

    mDisplaySelectAction = new QAction(QIcon(":/images/toolbar/captureScreen.png"), tr("Capture the Screen"), this);
    connect(mDisplaySelectAction, SIGNAL(triggered()), this, SIGNAL(screenClick()));
    actions << mDisplaySelectAction;

    QIcon showHideIcon;
    showHideIcon.addPixmap(QPixmap(":/images/toolbar/eyeOpened.png"), QIcon::Normal , QIcon::On);
    showHideIcon.addPixmap(QPixmap(":/images/toolbar/eyeClosed.png"), QIcon::Normal , QIcon::Off);
    mShowHideAction = new QAction(showHideIcon, "", this);
    mShowHideAction->setCheckable(true);

    connect(mShowHideAction, SIGNAL(triggered(bool)), this, SLOT(showHideClick(bool)));
#ifndef Q_WS_X11
    actions << mShowHideAction;
#endif

    setActions(actions);
    setButtonIconSize(QSize(42, 42));

    adjustSizeAndPosition();

    //  This palette can be minimized
    QIcon maximizeIcon;
    maximizeIcon.addPixmap(QPixmap(":/images/toolbar/stylusTab.png"), QIcon::Normal, QIcon::On);
    mMaximizeAction = new QAction(maximizeIcon, tr("Show the stylus palette"), this);
    connect(mMaximizeAction, SIGNAL(triggered()), this, SLOT(maximizeMe()));
    connect(this, SIGNAL(maximizeStart()), this, SLOT(maximizeMe()));
    connect(this, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(minimizeMe(eMinimizedLocation)));
    setMinimizePermission(true);
}
Exemplo n.º 3
0
void UBZoomPalette::showHideExtraButton()
{
    if (mIsExpanded)
    {
        mHundredButton->setVisible(false);
        mIsExpanded = false;
        adjustSizeAndPosition(false);
    }
    else
    {
        mHundredButton->setVisible(true);
        mIsExpanded = true;
        adjustSizeAndPosition(true);
    }

}
Exemplo n.º 4
0
//  Called when the user wants to maximize the palette
void UBDesktopPalette::maximizeMe()
{
    QList<QAction*> actions;
    clearLayout();

    actions << mActionUniboard;
    actions << UBApplication::mainWindow->actionPen;
    actions << UBApplication::mainWindow->actionEraser;
    actions << UBApplication::mainWindow->actionMarker;
    actions << UBApplication::mainWindow->actionSelector;
    actions << UBApplication::mainWindow->actionPointer;
    if (UBPlatformUtils::hasVirtualKeyboard())
        actions << UBApplication::mainWindow->actionVirtualKeyboard;

    actions << mActionCustomSelect;
    actions << mDisplaySelectAction;
    actions << mShowHideAction;

    setActions(actions);

    adjustSizeAndPosition();

    // Notify that the maximization has been done
    emit maximized();
#ifdef Q_OS_LINUX
        emit refreshMask();
#endif
}
Exemplo n.º 5
0
void UBKeyboardPalette::leaveEvent ( QEvent * )
{
    if (languagePopupActive || !keyboardActive || mIsMoving)
        return;

    keyboardActive = false;

    adjustSizeAndPosition();

    emit keyboardActivated(false);
}
Exemplo n.º 6
0
void UBKeyboardPalette::enterEvent ( QEvent * )
{
    if (keyboardActive)
        return;

    keyboardActive = true;

    adjustSizeAndPosition();

    emit keyboardActivated(true);
}
Exemplo n.º 7
0
UBDocumentToolsPalette::UBDocumentToolsPalette(QWidget *parent)
    : UBActionPalette(Qt::TopRightCorner, parent)
{
    QList<QAction*> actions;

    if (UBPlatformUtils::hasVirtualKeyboard())
        actions << UBApplication::mainWindow->actionVirtualKeyboard;

    setActions(actions);
    setButtonIconSize(QSize(42, 42));

    adjustSizeAndPosition();
}
Exemplo n.º 8
0
/// Show dialog in simple way.
void OnyxSearchDialog::showSearching()
{
    setMode(MODE_SEARCHING);

    if (isHidden())
    {
        show();
    }

    updateChildrenWidgets(mode());
    adjustSizeAndPosition();
    updateTitle();
}
Exemplo n.º 9
0
UBStylusPalette::UBStylusPalette(QWidget *parent, Qt::Orientation orient)
    : UBActionPalette(Qt::TopLeftCorner, parent, orient)
    , mLastSelectedId(-1)
{
    QList<QAction*> actions;

    actions << UBApplication::mainWindow->actionPen;
    actions << UBApplication::mainWindow->actionEraser;
    actions << UBApplication::mainWindow->actionMarker;
    actions << UBApplication::mainWindow->actionSelector;
    actions << UBApplication::mainWindow->actionPlay;

    actions << UBApplication::mainWindow->actionHand;
    actions << UBApplication::mainWindow->actionZoomIn;
    actions << UBApplication::mainWindow->actionZoomOut;

    actions << UBApplication::mainWindow->actionPointer;
    actions << UBApplication::mainWindow->actionLine;
    actions << UBApplication::mainWindow->actionText;
    actions << UBApplication::mainWindow->actionCapture;

    if(UBPlatformUtils::hasVirtualKeyboard())
        actions << UBApplication::mainWindow->actionVirtualKeyboard;

    setActions(actions);
    setButtonIconSize(QSize(42, 42));

    if(!UBPlatformUtils::hasVirtualKeyboard())
    {
            groupActions();
    }
    else
    {
            // VirtualKeyboard action is not in group
            // So, groupping all buttons, except last
            mButtonGroup = new QButtonGroup(this);
            for(int i=0; i < mButtons.size()-1; i++)
            {
                    mButtonGroup->addButton(mButtons[i], i);
            }
        connect(mButtonGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(buttonGroupClicked(int)));
    }

    adjustSizeAndPosition();

    initPosition();

    foreach(const UBActionPaletteButton* button, mButtons)
    {
        connect(button, SIGNAL(doubleClicked()), this, SLOT(stylusToolDoubleClicked()));
    }
Exemplo n.º 10
0
//  Called when the palette is near the border and must be minimized
void UBDesktopPalette::minimizeMe(eMinimizedLocation location)
{
    Q_UNUSED(location);
    QList<QAction*> actions;
    clearLayout();

    actions << mMaximizeAction;
    setActions(actions);

    adjustSizeAndPosition();

#ifdef Q_OS_LINUX
        emit refreshMask();
#endif
}
Exemplo n.º 11
0
void UBKeyboardPalette::setKeyButtonSize(const QString& _strSize)
{
    QStringList strs = _strSize.split('x');

    if (strs.size()==2)
    {
        strSize = _strSize;
        btnWidth = strs[0].toInt();
        btnHeight = strs[1].toInt();

        if(currBtnImages != NULL)
            delete currBtnImages;
        currBtnImages = new BTNImages(strs[1], btnWidth, btnHeight);

        adjustSizeAndPosition();
    }
}
Exemplo n.º 12
0
/// This function is called by parent widget to display the search widget.
/// It shows line edit and keyboard.
void OnyxSearchDialog::showNormal()
{
    setMode(MODE_FULL);

    if (isHidden())
    {
        show();
    }

    updateChildrenWidgets(mode());
    adjustSizeAndPosition();

    // Set line edit view each time after updating the children and resize.
    if (editor()->text().isEmpty())
    {
        editor()->setText(ctx_.pattern());
    }
    updateTitle();
}
Exemplo n.º 13
0
/// Show next previous buttons and title bar.
void OnyxSearchDialog::showNextPrev()
{
    setMode(MODE_NEXT_PREV);

    if (isHidden())
    {
        show();
    }

    updateChildrenWidgets(mode());
    adjustSizeAndPosition();
    updateTitle();
    if (ctx_.forward())
    {
        next_prev_.setFocusTo(0, 1);
    }
    else
    {
        next_prev_.setFocusTo(0, 0);
    }
}
Exemplo n.º 14
0
void UBZoomPalette::refreshPalette()
{
    qreal currentZoomFactor = mBoardController->currentZoom();
    bool showAsNoZoom = (currentZoomFactor > 0.9 && currentZoomFactor < 1.1);
    if (showAsNoZoom)
    {
        currentZoomFactor = 1;
    }
    QString stringFactor = tr("%1 x").arg(currentZoomFactor, 0, 'f', 1);

    mCurrentZoomButton->setText(stringFactor);
    adjustSizeAndPosition();
    if (showAsNoZoom)
    {
        QTimer::singleShot(500, this, SLOT(hide()));
    }
    else
    {
        show();
        raise();
    }
}
Exemplo n.º 15
0
void UBPageNumberPalette::setPageNumber(int current, int total)
{
    mButton->setText(QString("%1 / %2").arg(current).arg(total));
    adjustSizeAndPosition();
}
UBDrawingFillPropertiesPalette::UBDrawingFillPropertiesPalette(Qt::Orientation orient, QWidget *parent)
    :UBAbstractSubPalette(orient, parent)
{
    hide();

    //Alpha button
    UBActionPaletteButton* btnAlphaColor = new UBActionPaletteButton(UBApplication::mainWindow->actionColorStyleTransparent, this);
    layout()->addWidget(btnAlphaColor);

    // ColorPicker button
    mBtnColorPicker = new UBColorPickerButton(this);
    mBtnColorPicker->setToolTip(tr("Select and set filling color"));
    mBtnColorPicker->setColor(UBApplication::boardController->shapeFactory().fillFirstColor());
    layout()->addWidget(mBtnColorPicker);
    connect(mBtnColorPicker, SIGNAL(clicked()), this, SLOT(onBtnSelectFillFirstColor()));    

    //layout "ColorStyle"
    QHBoxLayout* colorStyleLayout = new QHBoxLayout();
    colorStyleLayout->setSpacing(0);

    // ColorType buttons
    UBActionPaletteButton* btnFullColor = new UBActionPaletteButton(UBApplication::mainWindow->actionColorStyleFull, this);
    btnFullColor->setStyleSheet(styleSheetLeftGroupedButton);
    colorStyleLayout->addWidget(btnFullColor);
    UBApplication::mainWindow->actionColorStyleFull->setChecked(true);

    UBActionPaletteButton* btnFillStyleDense = new UBActionPaletteButton(UBApplication::mainWindow->actionFillStyleDense, this);
    btnFillStyleDense->setStyleSheet(styleSheetCenterGroupedButton);
    colorStyleLayout->addWidget(btnFillStyleDense);

    UBActionPaletteButton* btnFillStyleDiag = new UBActionPaletteButton(UBApplication::mainWindow->actionFillStyleDiag, this);
    btnFillStyleDiag->setStyleSheet(styleSheetCenterGroupedButton);
    colorStyleLayout->addWidget(btnFillStyleDiag);

    UBActionPaletteButton* btnGradientColor = new UBActionPaletteButton(UBApplication::mainWindow->actionColorStyleGradient, this);
    btnGradientColor->setStyleSheet(styleSheetRightGroupedButton);
    colorStyleLayout->addWidget(btnGradientColor);

    //group color style buttons
    mButtonGroupColorStyle = new QButtonGroup(this);
    mButtonGroupColorStyle->addButton(btnFillStyleDiag);
    mButtonGroupColorStyle->addButton(btnFillStyleDense);
    mButtonGroupColorStyle->addButton(btnFullColor);
    mButtonGroupColorStyle->addButton(btnGradientColor);

    connect(btnAlphaColor, SIGNAL(clicked()), this, SLOT(onBtnColorTransparent()));
    connect(btnFillStyleDense, SIGNAL(clicked()), this, SLOT(onBtnFillStyleDense()));
    connect(btnFillStyleDiag, SIGNAL(clicked()), this, SLOT(onBtnFillStyleDiag()));
    connect(btnFullColor, SIGNAL(clicked()), this, SLOT(onBtnColorFull()));
    connect(btnGradientColor, SIGNAL(clicked()), this, SLOT(onBtnColorGradient()));

    //group layouts to main layout
    QHBoxLayout* mainLayout = dynamic_cast<QHBoxLayout*>(layout());
    if (mainLayout)
    {
        mainLayout->addLayout(colorStyleLayout);
    }


    // ColorPicker button
    mBtnColor2Picker = new UBColorPickerButton(this);
    mBtnColor2Picker->setToolTip(tr("Select and set second filling color"));
    mBtnColor2Picker->setColor(UBApplication::boardController->shapeFactory().fillSecondColor());
    mBtnColor2Picker->setEnabled(false);
    layout()->addWidget(mBtnColor2Picker);
    connect(mBtnColor2Picker, SIGNAL(clicked()), this, SLOT(onBtnSelectFillSecondColor()));

    adjustSizeAndPosition();
}