config/versionguientry.cpp

Sun, 28 Nov 2021 23:45:30 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 28 Nov 2021 23:45:30 +0200
changeset 64
c55e46b7ddeb
parent 54
0b3a5bc4e8a8
permissions
-rw-r--r--

Read the colorset value recent Zandronum versions add into userinfo

#include <QLabel>
#include <QTableWidget>
#include "versionguientry.h"

//
// -----------------------------------------------------------------------------
//

VersionGuiEntry::VersionGuiEntry (const QString& name, bool isRelease,
	QLabel* label, QTableWidgetItem* pathItem)
	: m_name (name),
	  m_isRelease (isRelease),
	  m_label (label),
	  m_pathItem (pathItem)
{
	updateStyleSheet();
}

//
// -----------------------------------------------------------------------------
//

void VersionGuiEntry::setRelease (bool a)
{
	m_isRelease = a;
	updateStyleSheet();
}

//
// -----------------------------------------------------------------------------
//

void VersionGuiEntry::updateStyleSheet()
{
	m_label->setStyleSheet (m_isRelease ? "font-weight: bold" : "");
}

//
// -----------------------------------------------------------------------------
//

class QLabel* VersionGuiEntry::label()
{
	return m_label;
}

//
// -----------------------------------------------------------------------------
//

class QTableWidgetItem* VersionGuiEntry::pathItem()
{
	return m_pathItem;
}

//
// -----------------------------------------------------------------------------
//

const QString& VersionGuiEntry::name()
{
	return m_name;
}

//
// -----------------------------------------------------------------------------
//

bool VersionGuiEntry::isRelease()
{
	return m_isRelease;
}

mercurial