diff --git a/src/basicview.cpp b/src/basicview.cpp index 4c870d7..84c01d8 100644 --- a/src/basicview.cpp +++ b/src/basicview.cpp @@ -29,7 +29,7 @@ BasicView::BasicView() { basicView = new QWidget(); - topStatus = new QLabel("nil"); + topStatus = new QLabel("Loading ..."); QVBoxLayout *topBar = new QVBoxLayout; topStatus->setAlignment(Qt::AlignCenter); @@ -99,8 +99,12 @@ static QString getPauseLabel(bool isPaused) return Constants::pauseIcon; } -static QString getStartLabel(bool isRunning, bool isPaused) +static QString getStartLabel(bool exists, bool isRunning, bool isPaused) { + if (!exists) { + return Constants::createIcon; + } + if (isRunning || isPaused) { return Constants::reloadIcon; } @@ -115,12 +119,16 @@ static QString getPauseToolTip(bool isPaused) return "Pause Kubernetes cluster"; } -static QString getStartToolTip(bool isRunning, bool isPaused) +static QString getStartToolTip(bool exists, bool isRunning, bool isPaused) { + if (!exists) { + return "Create a new cluster"; + } + if (isRunning || isPaused) { return "Restart (reconfigure) an already running cluster"; } - return "Start the default cluster"; + return "Start the cluster"; } void BasicView::update(Cluster cluster) @@ -145,8 +153,8 @@ void BasicView::update(Cluster cluster) #endif pauseButton->setText(getPauseLabel(isPaused)); pauseButton->setToolTip(getPauseToolTip(isPaused)); - startButton->setText(getStartLabel(isRunning, isPaused)); - startButton->setToolTip(getStartToolTip(isRunning, isPaused)); + startButton->setText(getStartLabel(exists, isRunning, isPaused)); + startButton->setToolTip(getStartToolTip(exists, isRunning, isPaused)); } void BasicView::disableButtons() diff --git a/src/cluster.h b/src/cluster.h index 6ac2521..d24f7c1 100644 --- a/src/cluster.h +++ b/src/cluster.h @@ -28,7 +28,7 @@ class Cluster Cluster() : Cluster("") { } Cluster(const QString &name) : m_name(name), - m_status(""), + m_status("No Existing Cluster"), m_driver(""), m_container_runtime(""), m_k8s_version(""), diff --git a/src/constants.h b/src/constants.h index 4eacc11..d9a1246 100644 --- a/src/constants.h +++ b/src/constants.h @@ -30,6 +30,7 @@ class Constants inline static const QString unPauseIcon = "\uf04b"; inline static const QString deleteIcon = "\uf1f8"; inline static const QString reloadIcon = "\uf021"; + inline static const QString createIcon = "\uf0fe"; }; #endif // CONSTANTS_H diff --git a/src/fonts.cpp b/src/fonts.cpp index 1a99ca5..2197ca7 100644 --- a/src/fonts.cpp +++ b/src/fonts.cpp @@ -19,13 +19,14 @@ limitations under the License. #include #include #include +#include QFont Fonts::fontAwesome; void Fonts::initFonts() { loadFontAwesome(); - setToolTipFont(); + setToolTipStyle(); } void Fonts::loadFontAwesome() @@ -36,11 +37,16 @@ void Fonts::loadFontAwesome() fontAwesome.setPixelSize(20); } -void Fonts::setToolTipFont() +void Fonts::setToolTipStyle() { QFont tooltipFont = QToolTip::font(); - tooltipFont.setPointSize(20); + tooltipFont.setPointSize(18); QToolTip::setFont(tooltipFont); + QPalette palette; + palette.setColor(QPalette::ToolTipText, Qt::black); + palette.setColor(QPalette::ToolTipBase, Qt::lightGray); + QToolTip::setPalette(palette); + } void Fonts::setFontAwesome(QWidget *wid) diff --git a/src/fonts.h b/src/fonts.h index efc30be..fd5812f 100644 --- a/src/fonts.h +++ b/src/fonts.h @@ -28,7 +28,7 @@ class Fonts private: static void loadFontAwesome(); - static void setToolTipFont(); + static void setToolTipStyle(); static QFont fontAwesome; };