Example #1
0
void Panel::setHeight(int height)
{
    panelConfig().writeEntry("thickness", height);
    if (panel()) {
        QMetaObject::invokeMethod(panel(), "restore");
    }
}
void LxQtKbIndicator::realign()
{
    if (panel()->isHorizontal())
        mContent->setMinimumSize(0, panel()->iconSize());
    else
        mContent->setMinimumSize(panel()->iconSize(), 0);
}
Example #3
0
void Panel::setMaximumLength(int pixels)
{
   panelConfig().writeEntry("maxLength", pixels);
   if (panel()) {
       QMetaObject::invokeMethod(panel(), "restore");
   }
}
Example #4
0
void Panel::setOffset(int pixels)
{
   panelConfig().writeEntry("offset", pixels);
   if (panel()) {
       QMetaObject::invokeMethod(panel(), "restore");
   }
}
Example #5
0
void KbdState::realign()
{
    if (panel()->isHorizontal()){
        m_content.setMinimumSize(0, panel()->iconSize());
        m_content.showHorizontal();
    } else {
        m_content.setMinimumSize(panel()->iconSize(), 0);
        m_content.showVertical();
    }
}
Example #6
0
void RazorClock::mouseReleaseEvent(QMouseEvent* event)
{
    if (!calendarDialog)
    {
        calendarDialog = new QDialog(this);
        //calendarDialog->setAttribute(Qt::WA_DeleteOnClose, true);
        calendarDialog->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
        calendarDialog->setLayout(new QHBoxLayout(calendarDialog));
        calendarDialog->layout()->setMargin(1);

        QCalendarWidget* cal = new QCalendarWidget(calendarDialog);
        calendarDialog->layout()->addWidget(cal);
        calendarDialog->adjustSize();

        int x, y;
        RazorPanel::Position pos = panel()->position();
        QRect panelRect = panel()->geometry();
        int calHeight = calendarDialog->height();
        int calWidth = calendarDialog->width();

        if (pos == RazorPanel::PositionBottom || pos == RazorPanel::PositionTop)
        {
            int rightMax = panelRect.topRight().x() - calWidth + 1;
            x = panel()->mapToGlobal(this->geometry().topLeft()).x();
            if (x > rightMax)
                x = rightMax;
            if (pos == RazorPanel::PositionBottom)
                y = panelRect.top() - calHeight;
            else
                y = panelRect.bottom() + 1;
        }
        else // PositionRight or PositionLeft
        {
            int bottomMax = panelRect.bottomRight().y() - calHeight + 1;
            y = panel()->mapToGlobal(this->geometry().topRight()).y();
            if (y > bottomMax)
                y = bottomMax;
            if (pos == RazorPanel::PositionRight)
                x = panelRect.left() - calWidth;
            else
                x = panelRect.right() + 1;
        }

        calendarDialog->move(QPoint(x, y));
        calendarDialog->show();
    }
    else
    {
        delete calendarDialog;
        calendarDialog = 0;
    }
}
Example #7
0
void Panel::setAlignment(const QString &alignment)
{
    int a = Qt::AlignLeft;
    if (alignment.compare("right", Qt::CaseInsensitive) == 0) {
        a = Qt::AlignRight;
    } else if (alignment.compare("center", Qt::CaseInsensitive) == 0) {
        a = Qt::AlignCenter;
    }

    panelConfig().writeEntry("alignment", a);
    if (panel()) {
        QMetaObject::invokeMethod(panel(), "restore");
    }
}
Example #8
0
bool IMGUI::listBox(const Rect& ext, float rowHeight, const std::vector<std::string>& items, int& selIdx)
{
    bool selChanged = false;

    size_t nItems = items.size();
    float width = ext.r - ext.l;
    for (size_t i = 0; i < nItems; i++)
    {
        if (isMouseAction(Rect(ext.l, ext.t + i*rowHeight, ext.r, ext.t + (i + 1)*rowHeight), Mouse_Down, Mouse_Left) &&
            selIdx != i)
        {
            selChanged = true;
            selIdx = i;
        }
    }

    float y = ext.t;
    for (size_t i = 0; i < nItems; i++)
    {
        float textWidth = (float)g_pGLPainter->getTextWidth(items[i].c_str());
        Color textColor = 0xFFDDDDDD;

        if (i == selIdx)
        {
            panel(Rect(ext.l, y, ext.r, y + rowHeight), textColor);
            textColor = 0xFF222222;
        }
        float textY = y + (rowHeight - FONT_HEIGHT)*0.5f + FONT_HEIGHT;
        float textX = ext.l + (width - textWidth)*0.5f;
        g_pGLPainter->drawText(textX, textY, items[i].c_str(), textColor);
        y += rowHeight;
    }

    return selChanged;
}
void LLPanelGroup::showNotice(const std::string& subject,
					   const std::string& message,
					   const LLUUID& group_id,
					   const bool& has_inventory,
					   const std::string& inventory_name,
					   LLOfferInfo* inventory_offer)
{
	// <FS:Ansariel> Standalone group floaters
	//LLPanelGroup* panel = LLFloaterSidePanelContainer::getPanel<LLPanelGroup>("people", "panel_group_info_sidetray");
	LLPanelGroup* panel(NULL);

	if (gSavedSettings.getBOOL("FSUseStandaloneGroupFloater")) 
	{
		FSFloaterGroup* floater = FSFloaterGroup::findInstance(group_id);
		if (!floater)
		{
			return;
		}

		panel = floater->getGroupPanel();
	}
	else
	{
		panel = LLFloaterSidePanelContainer::getPanel<LLPanelGroup>("people", "panel_group_info_sidetray");
	}
	// </FS:Ansariel>

	if(!panel)
		return;

	if(panel->getID() != group_id)//???? only for current group_id or switch panels? FIXME
		return;
	panel->showNotice(subject,message,has_inventory,inventory_name,inventory_offer);

}
Example #10
0
int bbRequesters::Proceed( bbString title,bbString text,bbBool serious ){
	int flags=(serious ? MB_ICONWARNING : MB_ICONINFORMATION)|MB_YESNOCANCEL|MB_APPLMODAL|MB_TOPMOST;
	int n=panel( title,text,flags );
	if( n==IDYES ) return 1;
	if( n==IDNO ) return 0;
	return -1;
}
Example #11
0
edit_window_t::edit_window_t()
:	ntk_window(
		ted()->conf().get_rect("edit_window_t::frame", NRect(100, 100, 600, 500)),
		WINDOW_TITLE("untitled"), TITLED_WINDOW)
,	m_file_name("")
{
	set_icon_handle(LoadIcon(ntk::application()->handle(), MAKEINTRESOURCE(ID_TED_ICON)));

	panel()->set_view_color(ntk::transparent_color());

	ntk_std_menu_bar* menu_bar = new ntk_std_menu_bar(
		LoadMenu(ted()->handle(), MAKEINTRESOURCE(ID_APP_MENU)),
		ntk_rect(0, 0, 10, 10), "Menu");
	add_child(menu_bar);

	int width_list[] = {100, 100, 200};
	ntk_status_bar* status_bar = new ntk_status_bar("TestStatusBar");//, 3, width_list);
	add_child(status_bar);

//	add_child(new NScrollBar(bounds().inset_by_copy(10, 10), "VScrollBar", NULL, 0, 50));

	ntk_rect rect = bounds();
	rect.top += menu_bar->frame().height();
	rect.bottom -= status_bar->frame().height();

	m_edit = new ntk_scintilla(rect, "Text", "", ntk_view::FOLLOW_ALL_SIDES);
//	m_edit->set_ex_style(m_edit->ex_style() | WS_EX_CLIENTEDGE, true);
	add_child(m_edit);
}
boost::shared_ptr<ConnectionActivityPanel> ConnectionDisplayWindow::addComponent(
		const boost::shared_ptr<cryomesh::components::Connection> & connection,
		std::map<boost::uuids::uuid, boost::shared_ptr<ConnectionActivityPanel>> & panelsMap) {
	boost::shared_ptr<ConnectionActivityPanel> panel(new ConnectionActivityPanel(connection));
	panelsMap[connection->getUUID()] = panel;
	return panel;
}
Example #13
0
void Panel::setHiding(const QString &mode)
{
    PanelView::VisibilityMode visibilityMode = PanelView::NormalPanel;
    if (mode.compare("autohide", Qt::CaseInsensitive) == 0) {
        visibilityMode = PanelView::AutoHide;
    } else if (mode.compare("windowscover", Qt::CaseInsensitive) == 0) {
        visibilityMode = PanelView::LetWindowsCover;
    } else if (mode.compare("windowsbelow", Qt::CaseInsensitive) == 0) {
        visibilityMode = PanelView::WindowsGoBelow;
    }

    panelConfig().writeEntry("panelVisibility", (int)visibilityMode);
    if (panel()) {
        QMetaObject::invokeMethod(panel(), "restore");
    }
}
Example #14
0
static LLSD getTabInfo(LLPanel* tab)
{
    LLSD panels;
    for (LLPanel::tree_iterator_t ti(tab->beginTreeDFS()), tend(tab->endTreeDFS());
         ti != tend; ++ti)
    {
        // *ti is actually an LLView*, which had better not be NULL
        LLView* view(*ti);
        if (! view)
        {
            LL_ERRS("LLSideTrayListener") << "LLSideTrayTab '" << tab->getName()
                                          << "' has a NULL child LLView*" << LL_ENDL;
        }

        // The logic we use to decide what "panel" names to return is heavily
        // based on LLSideTray::showPanel(): the function that actually
        // implements the "SideTray.ShowPanel" operation. showPanel(), in
        // turn, depends on LLSideTray::openChildPanel(): when
        // openChildPanel() returns non-NULL, showPanel() stops searching
        // attached and detached LLSideTrayTab tabs.

        // For each LLSideTrayTab, openChildPanel() first calls
        // findChildView(panel_name, true). In other words, panel_name need
        // not be a direct LLSideTrayTab child, it's sought recursively.
        // That's why we use (begin|end)TreeDFS() in this loop.

        // But this tree_iterator_t loop will actually traverse every widget
        // in every panel. Returning all those names will not help our caller:
        // passing most such names to openChildPanel() would not do what we
        // want. Even though the code suggests that passing ANY valid
        // side-panel widget name to openChildPanel() will open the tab
        // containing that widget, results could get confusing since followup
        // (onOpen()) logic wouldn't be invoked, and showPanel() wouldn't stop
        // searching because openChildPanel() would return NULL.

        // We must filter these LLView items, using logic that (sigh!) mirrors
        // openChildPanel()'s own.

        // openChildPanel() returns a non-NULL LLPanel* when either:
        // - the LLView is a direct child of an LLSideTrayPanelContainer
        // - the LLView is itself an LLPanel.
        // But as LLSideTrayPanelContainer can directly contain LLView items
        // that are NOT themselves LLPanels (e.g. "sidebar_me" contains an
        // LLButton called "Jump Right Arrow"), we'd better focus only on
        // LLSideTrayPanelContainer children that are themselves LLPanel
        // items. Which means that the second test completely subsumes the
        // first.
        LLPanel* panel(dynamic_cast<LLPanel*>(view));
        if (panel)
        {
            // Maybe it's overkill to construct an LLSD::Map for each panel, but
            // the possibility remains that we might want to deliver more info
            // about each panel than just its name.
            panels.append(LLSDMap("name", panel->getName()));
        }
    }

    return LLSDMap("panels", panels);
}
Example #15
0
PreviewWindow::PreviewWindow(const NRect& frame)
:	NWindow(
		new PreviewPanel("PreviewPanel"),
		titoon()->conf().get_rect("PreviewWindow::frame", frame),
		"Preview", FLOATING_WINDOW)
{
	m_preview = static_cast<PreviewPanel*>(panel());
}
Example #16
0
RazorMount::RazorMount(const RazorPanelPluginStartInfo* startInfo, QWidget* parent)
    : RazorPanelPlugin(startInfo, parent)
{
    //qDebug() << "RazorMount init";
    setObjectName("RazorMount");
    m_button = new MountButton(parent, panel());
    addWidget(m_button);
    settigsChanged();
}
Example #17
0
// Sets the specified path, if possible. Otherwise reverts to the previously set path
FileOperationResultCode CController::setPath(Panel p, const QString &path, FileListRefreshCause operation)
{
	CPanel& targetPanel = panel(p);
	const QString prevPath = targetPanel.currentDirPathNative();
	const FileOperationResultCode result = targetPanel.setPath(path, operation);

	saveDirectoryForCurrentDisk(p);
	disksChanged(); // To select a proper drive button
	return result;
}
Example #18
0
bool IMGUI::slider(const Rect& ext, float minVal, float maxVal, float& val)
{
    bool bModified = false;
    if (isMouseAction(ext, Mouse_Down|Mouse_Move, Mouse_Left))
    {
        val = clamp(minVal + (maxVal - minVal)*(m_MouseX - ext.l)/ext.w(), minVal, maxVal);
        bModified = true;
    }

    bool bChanged = false;
    Rect bgExt(ext);
    bgExt.inflate(0.0f, -5.0f, 0.0f, -5.0f);
    panel(bgExt, 0xFFDDDDDD);
    float spos = clamp(val/(maxVal - minVal), 0.0f, 1.0f);
    float tx = ext.l + ext.w()*spos;
    Rect thumbExt(tx - 2.0f, ext.t, tx + 2.0f, ext.b);
    panel(thumbExt, 0xFFDDDDDD);
    return bModified;
}
Example #19
0
RazorVolume::RazorVolume(const RazorPanelPluginStartInfo* startInfo, QWidget* parent):
        RazorPanelPlugin(startInfo, parent),
        m_engine(0),
        m_defaultSinkIndex(0),
        m_defaultSink(0)
{
    setObjectName("Volume");

    layout()->setAlignment(Qt::AlignCenter);
    m_volumeButton = new VolumeButton(panel(), this);
    addWidget(m_volumeButton);

    m_notification = new RazorNotification("", this);
    m_configWindow = new RazorVolumeConfiguration(settings(), this);

    // global key shortcuts
    m_keyVolumeUp = new QxtGlobalShortcut(this);
    m_keyVolumeDown = new QxtGlobalShortcut(this);
    m_keyMuteToggle = new QxtGlobalShortcut(this);
    QString shortcutNotRegistered;

    QKeySequence keySequenceVolumeUp(Qt::Key_VolumeUp);
    if (!m_keyVolumeUp->setShortcut(keySequenceVolumeUp)) 
    {
        shortcutNotRegistered = "'" + keySequenceVolumeUp.toString() + "' ";
    }

    QKeySequence keySequenceVolumeDown(Qt::Key_VolumeDown);
    if (!m_keyVolumeDown->setShortcut(keySequenceVolumeDown)) 
    {
        shortcutNotRegistered += "'" + keySequenceVolumeDown.toString() + "' ";
    }

    QKeySequence keySequenceMuteToggle(Qt::Key_VolumeMute);
    if (!m_keyMuteToggle->setShortcut(keySequenceMuteToggle)) 
    {
        shortcutNotRegistered += "'" + keySequenceMuteToggle.toString() + "' ";
    }
    
    if(!shortcutNotRegistered.isEmpty())
    {
        m_notification->setSummary(tr("Volume Control: The following shortcuts can not be registered: %1").arg(shortcutNotRegistered));
        m_notification->update();
    }
    
    m_notification->setTimeout(1000);
    m_notification->setUrgencyHint(RazorNotification::UrgencyLow);

    connect(m_keyVolumeUp, SIGNAL(activated()), this, SLOT(handleShortcutVolumeUp()));
    connect(m_keyVolumeDown, SIGNAL(activated()), this, SLOT(handleShortcutVolumeDown()));
    connect(m_keyMuteToggle, SIGNAL(activated()), this, SLOT(handleShortcutVolumeMute()));

    settingsChanged();
}
 void buttonClicked(juce::Button* b) override {
     if (b == &button) {
         std::unique_ptr<juce::PropertyPanel> panel(new juce::PropertyPanel);
         panel->addProperties({new EnabledPropertyComponent(model)});
         panel->addProperties({new ChannelPropertyComponent(loader, model)});
         panel->setSize(300, panel->getTotalContentHeight());
         panel->setOpaque(false);
         juce::CallOutBox::launchAsynchronously(
                 panel.release(), button.getScreenBounds(), nullptr);
     }
 }
Example #21
0
size_t CController::currentDiskIndex(Panel p) const
{
	const auto& drives = _diskEnumerator.drives();
	for (size_t i = 0; i < drives.size(); ++i)
	{
		if (CFileSystemObject(panel(p).currentDirPathNative()).isChildOf(drives[i].fileSystemObject))
			return i;
	}

	return std::numeric_limits<int>::max();
}
Example #22
0
void LLWidgetReg::initClass(bool register_widgets)
{
	// Only need to register if the Windows linker has optimized away the
	// references to the object files.
	if (register_widgets)
	{
		LLDefaultChildRegistry::Register<LLButton> button("button");
		LLDefaultChildRegistry::Register<LLMenuButton> menu_button("menu_button");
		LLDefaultChildRegistry::Register<LLCheckBoxCtrl> check_box("check_box");
		LLDefaultChildRegistry::Register<LLComboBox> combo_box("combo_box");
		LLDefaultChildRegistry::Register<LLFilterEditor> filter_editor("filter_editor");
		LLDefaultChildRegistry::Register<LLFlyoutButton> flyout_button("flyout_button");
		LLDefaultChildRegistry::Register<LLContainerView> container_view("container_view");
		LLDefaultChildRegistry::Register<LLIconCtrl> icon("icon");
		LLDefaultChildRegistry::Register<LLLoadingIndicator> loading_indicator("loading_indicator");
		LLDefaultChildRegistry::Register<LLLineEditor> line_editor("line_editor");
		LLDefaultChildRegistry::Register<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator");
		LLDefaultChildRegistry::Register<LLMenuItemCallGL> menu_item_call_gl("menu_item_call");
		LLDefaultChildRegistry::Register<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check");
		LLDefaultChildRegistry::Register<LLMenuGL> menu("menu");
		LLDefaultChildRegistry::Register<LLMenuBarGL> menu_bar("menu_bar");
		LLDefaultChildRegistry::Register<LLContextMenu> context_menu("context_menu");
		LLDefaultChildRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar");
		LLDefaultChildRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider");
		LLDefaultChildRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML);
		LLDefaultChildRegistry::Register<LLLayoutStack> layout_stack("layout_stack");
		LLDefaultChildRegistry::Register<LLProgressBar> progress_bar("progress_bar");
		LLDefaultChildRegistry::Register<LLRadioGroup> radio_group("radio_group");
		LLDefaultChildRegistry::Register<LLSearchEditor> search_editor("search_editor");
		LLDefaultChildRegistry::Register<LLScrollContainer> scroll_container("scroll_container");
		LLDefaultChildRegistry::Register<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list");
		LLDefaultChildRegistry::Register<LLScrollListCtrl> scroll_list("scroll_list");
		LLDefaultChildRegistry::Register<LLSlider> slider_bar("slider_bar");
		LLDefaultChildRegistry::Register<LLSliderCtrl> slider("slider");
		LLDefaultChildRegistry::Register<LLSpinCtrl> spinner("spinner");
		LLDefaultChildRegistry::Register<LLStatBar> stat_bar("stat_bar");
		//LLDefaultChildRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder");
		LLDefaultChildRegistry::Register<LLTabContainer> tab_container("tab_container");
		LLDefaultChildRegistry::Register<LLTextBox> text("text");
		LLDefaultChildRegistry::Register<LLTimeCtrl> time("time");
		LLDefaultChildRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor");
		LLDefaultChildRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl");
		LLDefaultChildRegistry::Register<LLStatView> stat_view("stat_view");
		//LLDefaultChildRegistry::Register<LLUICtrlLocate> locate("locate");
		//LLDefaultChildRegistry::Register<LLUICtrlLocate> pad("pad");
		LLDefaultChildRegistry::Register<LLViewBorder> view_border("view_border");
	}

	// *HACK: Usually this is registered as a viewer text editor
	LLDefaultChildRegistry::Register<LLTextEditor> text_editor("text_editor");
}
Example #23
0
void BBSplitter::layoutChildren(){

	if( (style()&3)==1 ){
		panel(0)->setShape( 0,0,_divx,clientHeight() );
		panel(1)->setShape( _divx+_divw,0,clientWidth()-_divx-_divw,clientHeight() );
	}else if( (style()&3)==2 ){
		panel(0)->setShape( 0,0,clientWidth(),_divy );
		panel(1)->setShape( 0,_divy+_divh,clientWidth(),clientHeight()-_divy-_divh );
	}else if( (style()&3)==3 ){
		panel(0)->setShape( 0,0,_divx,_divy );
		panel(1)->setShape( _divx+_divw,0,clientWidth()-_divx-_divw,_divy );
		panel(2)->setShape( 0,_divy+_divh,_divx,clientHeight()-_divy-_divh );
		panel(3)->setShape( _divx+_divw,_divy+_divh,clientWidth()-_divx-_divw,clientHeight()-_divy-_divh );
	}
}
Example #24
0
void RazorMainMenu::showMenu()
{
    if (!mMenu)
        return;

    int x=0, y=0;

    switch (panel()->position())
    {
        case IRazorPanel::PositionTop:
            x = mButton.mapToGlobal(QPoint(0, 0)).x();
            y = panel()->globalGometry().bottom();
            break;

        case IRazorPanel::PositionBottom:
            x = mButton.mapToGlobal(QPoint(0, 0)).x();
            y = panel()->globalGometry().top() - mMenu->sizeHint().height();
            break;

        case IRazorPanel::PositionLeft:
            x = panel()->globalGometry().right();
            y = mButton.mapToGlobal(QPoint(0, 0)).y();
            break;

        case IRazorPanel::PositionRight:
            x = panel()->globalGometry().left() - mMenu->sizeHint().width();
            y = mButton.mapToGlobal(QPoint(0, 0)).y();
            break;
    }

    // Just using Qt`s activateWindow() won't work on some WMs like Kwin.
    // There are two solutions:
    //  activate window with Qt call and then execute menu 1ms later using timer,
    //  or use native X11 API calls:
    //xfitMan().raiseWindow(mButton.effectiveWinId());
    mButton.activateWindow();
    mMenu->exec(QPoint(x, y));
}
Example #25
0
File: window.cpp Project: snori/ntk
void
gl_window_t::message_received(const ntk_message& message)
{
	switch(message.what)
	{
	case ntk::REFS_RECEIVED:
		app()->scene().load_MQO(message.find_string("name"));
		panel()->invalidate();
		break;

	default:
		ntk_window::message_received(message);
	}
}
Example #26
0
NewDocumentDialog::NewDocumentDialog()
:	NWindow(
		new NDialogPanel(
			MAKEINTRESOURCE(ID_NEW_DOCUMENT_DIALOG), NRect(), "NewDialog",
			NView::FOLLOW_LEFT | NView::FOLLOW_TOP, NDialogPanel::RESIZE_TO_FIT),
		NRect(100, 100, 300, 300), "�V�K�쐬", TITLED_LOOK, MODAL_APP_FEEL,
		NOT_RESIZABLE | NOT_ZOOMABLE | NOT_MINIMIZABLE)
{
	NDialogPanel* dialog_panel = reinterpret_cast<NDialogPanel*>(panel());
	SetDlgItemText(dialog_panel->handle(), ID_WIDTH, "160");
	SetDlgItemText(dialog_panel->handle(), ID_HEIGHT, "120");

	resize_to(dialog_panel->frame().width(), dialog_panel->frame().height());
	move_to(
		(NScreen::frame().width() - frame().width()) /2,
		(NScreen::frame().height() - frame().height()) /2);
}
Example #27
0
void DesktopSwitch::realign()
{
    int columns = static_cast<int>(ceil(static_cast<float>(m_desktopCount) / mRows));
    mLayout->setEnabled(false);
    if (panel()->isHorizontal())
    {
        mLayout->setRowCount(mRows);
        mLayout->setColumnCount(0);
        mDesktops->setDesktopLayout(NET::OrientationHorizontal, columns, mRows, mWidget.isRightToLeft() ? NET::DesktopLayoutCornerTopRight : NET::DesktopLayoutCornerTopLeft);
    }
    else
    {
        mLayout->setColumnCount(mRows);
        mLayout->setRowCount(0);
        mDesktops->setDesktopLayout(NET::OrientationHorizontal, mRows, columns, mWidget.isRightToLeft() ? NET::DesktopLayoutCornerTopRight : NET::DesktopLayoutCornerTopLeft);
    }
    mLayout->setEnabled(true);
}
Example #28
0
bool IMGUI::toggleButton(const Rect& ext, const char* text, bool& bPressed)
{
    bool bModified = false;
    if (isMouseAction(ext, Mouse_Down, Mouse_Left))
    {
        bPressed = !bPressed;
        bModified = true;
    }
    Color textColor  = bPressed ? 0xFFDDDDDD : 0xFF222222;
    Color panelColor = bPressed ? 0xFF222222 : 0xFFDDDDDD;
    panel(ext, panelColor);

    float textWidth = (float)g_pGLPainter->getTextWidth(text);
    float textY = ext.t + (ext.b - ext.t - FONT_HEIGHT)*0.5f + FONT_HEIGHT;
    float textX = ext.l + (ext.r - ext.l - textWidth)*0.5f;
    g_pGLPainter->drawText(textX, textY, text, textColor);
    return bModified;
}
Example #29
0
void LXQtWorldClock::realign()
{
    if (mAutoRotate)
        switch (panel()->position())
        {
        case ILXQtPanel::PositionTop:
        case ILXQtPanel::PositionBottom:
            mRotatedWidget->setOrigin(Qt::TopLeftCorner);
            break;

        case ILXQtPanel::PositionLeft:
            mRotatedWidget->setOrigin(Qt::BottomLeftCorner);
            break;

        case ILXQtPanel::PositionRight:
            mRotatedWidget->setOrigin(Qt::TopRightCorner);
            break;
        }
    else
        mRotatedWidget->setOrigin(Qt::TopLeftCorner);
}
Example #30
0
// Indicates that an item was activated and appropriate action should be taken. Returns error message, if any
FileOperationResultCode CController::itemActivated(qulonglong itemHash, Panel p)
{
	const auto item = panel(p).itemByHash(itemHash);
	if (item.isDir())
	{
		// Attempting to enter this dir
		const FileOperationResultCode result = setPath(p, item.fullAbsolutePath(), item.isCdUp() ? refreshCauseCdUp : refreshCauseForwardNavigation);
		return result;
	}
	else if (item.isFile())
	{
		if (item.isExecutable())
			// Attempting to launch this exe from the current directory
			return QProcess::startDetached(toPosixSeparators(item.fullAbsolutePath()), QStringList(), toPosixSeparators(item.parentDirPath())) ? rcOk : rcFail;
		else
			// It's probably not a binary file, try opening with openUrl
			return QDesktopServices::openUrl(QUrl::fromLocalFile(toPosixSeparators(item.fullAbsolutePath()))) ? rcOk : rcFail;
	}

	return rcFail;
}