Example #1
0
TabBarItem::TabBarItem(QWidget *AParent) : QFrame(AParent)
{
	FActive = true;
	FDraging = false;
	FIconSize = QSize(16,16);
	FLeft = FRight = FTop = FBottom = false;

	setProperty("ignoreFilter", true);

	setMouseTracking(true);

	setLayout(new QHBoxLayout);
	layout()->setMargin(2);
	layout()->setSpacing(2);

	layout()->addWidget(FIconLabel = new QLabel(this));
	FIconLabel->setObjectName("statusIconLabel");
	FIconLabel->setTextInteractionFlags(Qt::NoTextInteraction);
	FIconLabel->installEventFilter(this);
	FIconLabel->setFixedSize(FIconSize);

	layout()->addWidget(FTextLabel = new CustomLabel(this));
	FTextLabel->setElideMode(Qt::ElideNone);
	FTextLabel->setObjectName("tabBarItemLabel");
	FTextLabel->setShadow(CustomLabel::LightShadow);
	FTextLabel->setTextInteractionFlags(Qt::NoTextInteraction);
	FTextLabel->installEventFilter(this);
	FTextLabel->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);

	layout()->addWidget(FCloseButton = new CloseButton(this));
	FCloseButton->setFixedSize(16,16);
	FCloseButton->installEventFilter(this);
	StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(FCloseButton,STS_MESSAGEWIDGETS_TABCLOSEBUTTON);
	connect(FCloseButton,SIGNAL(clicked()),SIGNAL(closeButtonClicked()));

	GraphicsEffectsStorage::staticStorage(RSR_STORAGE_GRAPHICSEFFECTS)->installGraphicsEffect(FIconLabel, GFX_STATUSICONS);

	FIconHidden = false;
	FBlinkTimer.setSingleShot(true);
	connect(&FBlinkTimer,SIGNAL(timeout()),SLOT(onBlinkTimerTimeout()));

	FUpdateTimer.setInterval(0);
	FUpdateTimer.setSingleShot(true);
	connect(&FUpdateTimer,SIGNAL(timeout()),SLOT(onUpdateTimerTimeout()));

	FIconLabel->setProperty("ignoreFilter", true);
	FTextLabel->setProperty("ignoreFilter", true);
	FCloseButton->setProperty("ignoreFilter", true);

	setActive(false);
	setDraging(false);
}
Example #2
0
TrayManager::TrayManager()
{
	FPluginManager = NULL;

	FActiveNotify = -1;

	QPixmap empty(16,16);
	empty.fill(Qt::transparent);
	FEmptyIcon.addPixmap(empty);

	FContextMenu = new Menu;
	FSystemIcon.setContextMenu(FContextMenu);

	FBlinkVisible = true;
	FBlinkTimer.setSingleShot(true);
	connect(&FBlinkTimer,SIGNAL(timeout()),SLOT(onBlinkTimerTimeout()));

	connect(&FSystemIcon,SIGNAL(messageClicked()), SIGNAL(messageClicked()));
	connect(&FSystemIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(onTrayIconActivated(QSystemTrayIcon::ActivationReason)));
}