Exemplo n.º 1
0
VolumeCtrl::VolumeCtrl(Panel *p, QWidget *parent)
	: GenericButton(p, parent)
{
	can_Activated = false;
	setFixedWidth(28);
	setIconSize(QSize(19, 18));	
	volumeSlider = new SliderWidget();
	
	connect(volumeSlider, SIGNAL(volumeChanged(int)), this, SLOT(updateIcon(int)));
	updateIcon(volumeSlider->snd->volume());
}
Exemplo n.º 2
0
void ChatUserNotify::iconClicked()
{
	ChatDialog *chatDialog = NULL;
    // ChatWidget removes the waiting chat from the list with clearWaitingChat()
    chatDialog = ChatDialog::getChat(waitingChats.begin()->first, RS_CHAT_OPEN | RS_CHAT_FOCUS);

	if (chatDialog == NULL) {
		MainWindow::showWindow(MainWindow::Friends);
	}
    updateIcon();
}
Exemplo n.º 3
0
void SBI_ImagesIcon::toggleLoadingImages()
{
    bool current = testCurrentPageWebAttribute(QWebEngineSettings::AutoLoadImages);
    setCurrentPageWebAttribute(QWebEngineSettings::AutoLoadImages, !current);

    // We should reload page on disabling images
    if (current) {
        m_window->weView()->reload();
    }

    updateIcon();
}
Exemplo n.º 4
0
void lcQColorPicker::changed(int colorIndex)
{
	if (colorIndex == currentColorIndex)
		return;

	currentColorIndex = colorIndex;
	updateIcon();

	repaint();

	emit colorChanged(currentColorIndex);
}
Exemplo n.º 5
0
void DockAppItem::resizeResources()
{
    if (m_appIcon != NULL)
        updateIcon();

    if (m_appBG != NULL) {
        resizeBackground();
        m_appBG->move(0, 0);
    }

    updateTitle();
}
Exemplo n.º 6
0
/**
 * @brief Change "Pause" label
 * @param _pause
 */
void TrayIcon::onStartPause(bool _start)
{
    if (_start)
    {
        m_actionPause->setText(tr("Pause"));
    }
    else
    {
        m_actionPause->setText(tr("Start"));
    }

    updateIcon();
}
Exemplo n.º 7
0
void SiteIcon::setIcon(const QIcon &icon)
{
    bool wasNull = m_icon.isNull();

    m_icon = icon;

    if (wasNull) {
        updateIcon();
    }
    else {
        m_updateTimer->start();
    }
}
Exemplo n.º 8
0
void PlayersListModel::playerJoinedRoom(const QString & nickname, bool notify)
{
    QModelIndex mi = nicknameIndex(nickname);

    if(mi.isValid())
    {
        setData(mi, true, RoomFilterRole);
        updateIcon(mi);
        updateSortData(mi);
    }

    emit nickAdded(nickname, notify);
}
Exemplo n.º 9
0
void SearchEdit::mouseMoveEvent(QMouseEvent * event)
{
	if (iconLabel->geometry().contains(event->pos()))
	{
		if (!text().isEmpty())
		{
			setCursor(QCursor(Qt::PointingHandCursor));
			updateIcon(Hover);
		}
		else
			setCursor(QCursor(Qt::IBeamCursor));
	}
	else
	{
		setCursor(QCursor(Qt::IBeamCursor));
		if (text().isEmpty())
			updateIcon(Ready);
		else
			updateIcon(InProgress);
	}
	QLineEdit::mouseMoveEvent(event);
}
Exemplo n.º 10
0
Client::Client(DockApplet* dockApplet, unsigned long handle)
	: m_dockItem(NULL)
{
	m_dockApplet = dockApplet;
	m_handle = handle;

	X11Support::registerForWindowPropertyChanges(m_handle);

	updateVisibility();
	updateName();
	updateIcon();
	updateUrgency();
}
Exemplo n.º 11
0
//=====================Tree=========================
AQProjectTreeWidget::AQProjectTreeWidget(QWidget *parent)
	: QTreeWidget(parent), m_pCurrentSelection(0), m_pProjectRoot(0)
{
	//Setup context menu
	setContextMenuPolicy(Qt::CustomContextMenu);
	connect(this, &AQProjectTreeWidget::customContextMenuRequested, this, &AQProjectTreeWidget::showContextMenu);
	//connect(this, &AQProjectTreeWidget::itemChanged, this, &AQProjectTreeWidget::onTreeItemChanged);

	//Auto update icon
	connect(this, &AQProjectTreeWidget::itemExpanded, [=](QTreeWidgetItem * item)
		{
			auto g_node = static_cast<AQProjectNode*>(item);
			g_node->updateIcon();
			
			auto gr_node = dynamic_cast<AGroupProjectNode*>(g_node->projectNode());
			if(gr_node)
				gr_node->setExpanded(true);
	});

	connect(this, &AQProjectTreeWidget::itemCollapsed, [=](QTreeWidgetItem * item)
		{
			auto g_node = static_cast<AQProjectNode*>(item);
			g_node->updateIcon();
			
			auto gr_node = dynamic_cast<AGroupProjectNode*>(g_node->projectNode());
			if(gr_node)
				gr_node->setExpanded(true);
	});

	connect(this, &AQProjectTreeWidget::itemChanged, this, &AQProjectTreeWidget::changeItemName);
	connect(this, &AQProjectTreeWidget::itemActivated, [=](QTreeWidgetItem * item)
		{
			auto g_node = static_cast<AQProjectNode*>(item);
			auto doc_node = dynamic_cast<ADocumentProjectNode*>(g_node->projectNode());
			if(doc_node)
				emit openNodeFileRequested(doc_node);
	});
}
// BrushStyleButton class
BrushStyleButton::BrushStyleButton(QWidget *parent)
    : QToolButton(parent)
{
    TimeMeasure t("BrushStyleButton");

    setCheckable(true);
    setPopupMode(QToolButton::InstantPopup);

    styleWidget = new BrushStyleWidget(this);
    updateIcon();

    connect(this, SIGNAL(toggled(bool)), this, SLOT(onToggled(bool)));
    connect(this->styleWidget, SIGNAL(closed()), this, SLOT(onStyleWidgetClosed()));
}
Exemplo n.º 13
0
KoResourcePopupAction::KoResourcePopupAction(QSharedPointer<KoAbstractResourceServerAdapter>resourceAdapter, QObject *parent)
:  KAction(parent)
, d(new Private())
{
    Q_ASSERT(resourceAdapter);

    d->menu = new QMenu();
    QWidget *widget = new QWidget(d->menu);
    QWidgetAction *wdgAction = new QWidgetAction(widget);

    d->resourceList = new KoResourceItemView(widget);
    d->resourceList->setModel(new KoResourceModel(resourceAdapter, widget));
    d->resourceList->setItemDelegate(new KoResourceItemDelegate(widget));
    KoResourceModel * resourceModel = qobject_cast<KoResourceModel*>(d->resourceList->model());
    if (resourceModel) {
        resourceModel->setColumnCount(1);
    }

    KoResource *resource = 0;
    if (resourceAdapter->resources().count() > 0) {
        resource = resourceAdapter->resources().at(0);
    }

    KoAbstractGradient *gradient = dynamic_cast<KoAbstractGradient*>(resource);
    KoPattern *pattern = dynamic_cast<KoPattern*>(resource);
    if (gradient) {
        QGradient *qg = gradient->toQGradient();
        qg->setCoordinateMode(QGradient::ObjectBoundingMode);
        d->background = QSharedPointer<KoShapeBackground>(new KoGradientBackground(qg));
    } else if (pattern) {
        KoImageCollection *collection = new KoImageCollection();
        d->background = QSharedPointer<KoShapeBackground>(new KoPatternBackground(collection));
        static_cast<KoPatternBackground*>(d->background.data())->setPattern(pattern->pattern());
    }

    QHBoxLayout *layout = new QHBoxLayout(widget);
    layout->addWidget(d->resourceList);
    widget->setLayout(layout);

    wdgAction->setDefaultWidget(widget);
    d->menu->addAction(wdgAction);
    setMenu(d->menu);
    new QHBoxLayout(d->menu);
    d->menu->layout()->addWidget(widget);
    d->menu->layout()->setMargin(0);

    connect(d->resourceList, SIGNAL(clicked(QModelIndex)), this, SLOT(indexChanged(QModelIndex)));

    updateIcon();
}
Exemplo n.º 14
0
void AgentWindow::updateIdentity()
{
	OC_METHODGATE();
	if(nullptr!=mAgent) {
		mAgent->updateDiscoveryClient();
		updateIcon();
	} else {
		qWarning()<<"WARNING: No Agent in agent window";
	}
	ui->widgetFace->setAgent(mAgent);
	ui->widgetDelivery->configure(mAgent);
	ui->widgetPairing->configure(mAgent);

}
Exemplo n.º 15
0
lcQColorPicker::lcQColorPicker(QWidget *parent)
	: QPushButton(parent)
{
	setFocusPolicy(Qt::StrongFocus);
	setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
	setAutoDefault(false);
	setCheckable(true);

	initialColorIndex = 0;
	currentColorIndex = 0;
	updateIcon();

	connect(this, SIGNAL(toggled(bool)), SLOT(buttonPressed(bool)));
}
    void update (const File& root,
                 const DirectoryContentsList::FileInfo* const fileInfo,
                 const int index_,
                 const bool highlighted_) throw()
    {
        thread.removeTimeSliceClient (this);

        if (highlighted_ != highlighted
             || index_ != index)
        {
            index = index_;
            highlighted = highlighted_;
            repaint();
        }

        File newFile;
        String newFileSize;
        String newModTime;

        if (fileInfo != 0)
        {
            newFile = root.getChildFile (fileInfo->filename);
            newFileSize = File::descriptionOfSizeInBytes (fileInfo->fileSize);
            newModTime = fileInfo->modificationTime.formatted (T("%d %b '%y %H:%M"));
        }

        if (newFile != file
             || fileSize != newFileSize
             || modTime != newModTime)
        {
            file = newFile;
            fileSize = newFileSize;
            modTime = newModTime;

            isDirectory = fileInfo != 0 && fileInfo->isDirectory;
            repaint();

            clearIcon();
        }

        if (file != File::nonexistent
            && icon == 0 && ! isDirectory)
        {
            updateIcon (true);

            if (icon == 0)
                thread.addTimeSliceClient (this);
        }
    }
Exemplo n.º 17
0
void KasGroupItem::addTask(Task::Ptr t)
{
    if(!t)
        return;

    items.append(t);
    if(items.count() == 1)
    {
        setText(t->visibleName());
        updateIcon();
    }

    connect(t, SIGNAL(changed(bool)), this, SLOT(update()));
    update();
}
Exemplo n.º 18
0
void HWChatWidget::setReadyStatus(const QString & nick, bool isReady)
{
    QList<QListWidgetItem *> items = chatNicks->findItems(nick, Qt::MatchExactly);
    if (items.size() != 1)
    {
        qWarning("Bug: cannot find user in chat");
        return;
    }

    items[0]->setData(Qt::UserRole, isReady); // bulb status
    updateIcon(items[0]);

    // ensure we're still showing the status bulbs
    showReady = true;
}
Exemplo n.º 19
0
// ==============
//   PRIVATE SLOTS
// ==============
void TrayIcon::slotAttach(){
  IID = LX11::CreateWindow( this->winId(), this->rect() );
  if( LX11::EmbedWindow(AID, IID) ){
    LX11::RestoreWindow(AID); //make it visible
    updateIcon();
    qDebug() << "System Tray App:" << AID;
    emit AppAttached();
  }else{
    qWarning() << "Could not Embed Tray Application:" << AID;
    LX11::DestroyWindow(IID);
    IID = 0;
    AID = 0;
    emit AppClosed();
  }
}
Exemplo n.º 20
0
void PlayersListModel::playerLeftRoom(const QString & nickname)
{
    emit nickRemoved(nickname);

    QModelIndex mi = nicknameIndex(nickname);

    if(mi.isValid())
    {
        setData(mi, false, RoomFilterRole);
        setData(mi, false, RoomAdmin);
        setData(mi, false, Ready);
        setData(mi, false, InGame);
        updateIcon(mi);
    }
}
Exemplo n.º 21
0
void StelButton::initCtor(const QPixmap& apixOn,
                          const QPixmap& apixOff,
                          const QPixmap& apixNoChange,
                          const QPixmap& apixHover,
                          StelAction* aaction,
			  bool noBackground,
                          bool isTristate)
{
	pixOn = apixOn;
	pixOff = apixOff;
	pixHover = apixHover;
	pixNoChange = apixNoChange;
	noBckground = noBackground;
	isTristate_ = isTristate;
	opacity = 1.;
	hoverOpacity = 0.;
	action = aaction;
	checked = false;
	flagChangeFocus = false;

	Q_ASSERT(!pixOn.isNull());
	Q_ASSERT(!pixOff.isNull());

	if (isTristate_)
	{
		Q_ASSERT(!pixNoChange.isNull());
	}

	setShapeMode(QGraphicsPixmapItem::BoundingRectShape);	
	setAcceptHoverEvents(true);
	timeLine = new QTimeLine(250, this);
	timeLine->setCurveShape(QTimeLine::EaseOutCurve);
	connect(timeLine, SIGNAL(valueChanged(qreal)),
	        this, SLOT(animValueChanged(qreal)));
	connect(&StelMainView::getInstance(), SIGNAL(updateIconsRequested()), this, SLOT(updateIcon()));  // Not sure if this is ever called?
	StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
	connect(gui, SIGNAL(flagUseButtonsBackgroundChanged(bool)), this, SLOT(updateIcon()));

	if (action!=Q_NULLPTR)
	{
		if (action->isCheckable())
		{
			setChecked(action->isChecked());
			connect(action, SIGNAL(toggled(bool)), this, SLOT(setChecked(bool)));
			connect(this, SIGNAL(toggled(bool)), action, SLOT(setChecked(bool)));
		}
		else
		{
Exemplo n.º 22
0
void Action::initialize()
{
	const ActionsManager::ActionDefinition definition(getDefinition());

	switch (m_identifier)
	{
		case ActionsManager::PreferencesAction:
			setMenuRole(QAction::PreferencesRole);

			break;
		case ActionsManager::AboutQtAction:
			setMenuRole(QAction::AboutQtRole);

			break;
		case ActionsManager::ExitAction:
			setMenuRole(QAction::QuitRole);

			break;
		case ActionsManager::AboutApplicationAction:
			setMenuRole(QAction::AboutRole);

			break;
		default:
			break;
	}

	setShortcutContext(Qt::WidgetShortcut);

	if (definition.isValid())
	{
		if (definition.flags.testFlag(ActionsManager::ActionDefinition::IsCheckableFlag))
		{
			setCheckable(true);
		}

		if (definition.flags.testFlag(ActionsManager::ActionDefinition::IsDeprecatedFlag))
		{
			Console::addMessage(tr("Creating instance of deprecated action: %1").arg(ActionsManager::getActionName(m_identifier)), Console::OtherCategory, Console::WarningLevel);
		}

		connect(this, &Action::triggered, this, &Action::triggerAction);
	}

	updateIcon();
	updateState();

	connect(ActionsManager::getInstance(), &ActionsManager::shortcutsChanged, this, &Action::updateShortcut);
}
Exemplo n.º 23
0
LxQtTaskButton::LxQtTaskButton(const WId window, QWidget *parent) :
    QToolButton(parent),
    mWindow(window),
    mDrawPixmap(false)
{
    setCheckable(true);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    setMinimumWidth(1);
    setMinimumHeight(1);
    setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    setAcceptDrops(true);

    updateText();
    updateIcon();
}
Exemplo n.º 24
0
void DockAppItem::initData()
{
    StringMap dataMap = m_entryProxyer->data();
    m_itemData.title = dataMap.value("title");
    m_itemData.iconPath = dataMap.value("icon");
    m_itemData.menuJsonString = dataMap.value("menu");
    updateXidTitleMap();
    m_itemData.isActived = dataMap.value("app-status") == "active";
    m_itemData.currentOpened = m_itemData.xidTitleMap.keys().indexOf(m_clientManager->CurrentActiveWindow().value()) != -1;
    m_itemData.id = m_entryProxyer->id();

    setActived(m_itemData.isActived);
    setCurrentOpened(m_clientManager->CurrentActiveWindow());
    updateIcon();
    updateTitle();
}
    void paintItem (Graphics& g, int width, int height)
    {
        if (file != File::nonexistent)
        {
            updateIcon (true);

            if (icon.isNull())
                thread.addTimeSliceClient (this);
        }

        owner.getLookAndFeel().drawFileBrowserRow (g, width, height,
                                                   file.getFileName(),
                                                   &icon, fileSize, modTime,
                                                   isDirectory, isSelected(),
                                                   indexInContentsList, owner);
    }
Exemplo n.º 26
0
SiteIcon::SiteIcon(BrowserWindow* window, LocationBar* parent)
    : ToolButton(parent)
    , m_window(window)
    , m_locationBar(parent)
    , m_view(0)
{
    setObjectName("locationbar-siteicon");
    setToolButtonStyle(Qt::ToolButtonIconOnly);
    setCursor(Qt::ArrowCursor);
    setToolTip(LocationBar::tr("Show information about this page"));
    setFocusPolicy(Qt::ClickFocus);

    m_updateTimer = new QTimer(this);
    m_updateTimer->setInterval(100);
    m_updateTimer->setSingleShot(true);
    connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateIcon()));
}
Exemplo n.º 27
0
void NetStatus::bytesReceived(int count)
{
    // TODO show statistics
    _recvbytes += count;
    if(!(_activity & 2)) {
        _activity |= 2;
        updateIcon();
    }
    if(_download->isVisible()) {
        int val = _download->value() + count;
        if(val>=_download->maximum())
            _download->hide();
        else
            _download->setValue(val);
    }
    _timer->start(500);
}
Exemplo n.º 28
0
void NetStatus::bytesSent(int count)
{
    // TODO show statistics
    _sentbytes += count;
    if(!(_activity & 1)) {
        _activity |= 1;
        updateIcon();
    }
    if(_upload->isVisible()) {
        int val = _upload->value() + count;
        if(val>=_upload->maximum())
            _upload->hide();
        else
            _upload->setValue(val);
    }
    _timer->start(500);
}
Exemplo n.º 29
0
void KoColorPopupAction::setCurrentColor( const KoColor &color )
{
    d->colorChooser->slotSetColor( color );

    KoColor minColor( color );
    d->currentColor = minColor;

    KoColor maxColor( color );
    minColor.setOpacity( OPACITY_TRANSPARENT_U8 );
    maxColor.setOpacity( OPACITY_OPAQUE_U8 );
    d->opacitySlider->blockSignals( true );
    d->opacitySlider->setColors( minColor, maxColor );
    d->opacitySlider->setValue( color.opacityU8() );
    d->opacitySlider->blockSignals( false );

    updateIcon();
}
// private slot:
void kpColorSimilarityToolBarItem::slotFlashTimerTimeout ()
{
#if DEBUG_KP_COLOR_SIMILARITY_TOOL_BAR_ITEM
    qCDebug(kpLogWidgets) << "kpColorSimilarityToolBarItem::slotFlashTimerTimeout()"
              << " highlight=" << m_flashHighlight << endl;
#endif
    int newHigh = m_flashHighlight - 20;
    if (newHigh < 0)
        newHigh = 0;

    m_flashHighlight = newHigh;

    updateIcon ();

    if (newHigh == 0)
        m_flashTimer->stop ();
}