Welcome: Prohibit rename and delete of default session

Task-number: QTCREATORBUG-19642
Change-Id: I97d9fa84aad510fd8c2d95d3324f77fbcae4e9d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Christian Stenger
2018-02-08 08:53:06 +01:00
parent 6cc61be23b
commit f350018999
7 changed files with 10 additions and 2 deletions

View File

@@ -162,6 +162,7 @@ Welcome_ButtonBackgroundColor=normalBackground
Welcome_DividerColor=ff555555
Welcome_HoverColor=ff444444
Welcome_LinkColor=ff78bb39
Welcome_DisabledLinkColor=textDisabled
Timeline_TextColor=text
Timeline_BackgroundColor1=normalBackground

View File

@@ -154,6 +154,7 @@ Welcome_ButtonBackgroundColor=ffdfdfdf
Welcome_DividerColor=ffd6d6d6
Welcome_HoverColor=ffe8e8e8
Welcome_LinkColor=ff5caa15
Welcome_DisabledLinkColor=textDisabled
Timeline_TextColor=darkText
Timeline_BackgroundColor1=ffffffff

View File

@@ -167,6 +167,7 @@ Welcome_ButtonBackgroundColor=normalBackground
Welcome_DividerColor=ff555555
Welcome_HoverColor=ff444444
Welcome_LinkColor=ff7fc63c
Welcome_DisabledLinkColor=textDisabled
Timeline_TextColor=text
Timeline_BackgroundColor1=normalBackground

View File

@@ -165,6 +165,7 @@ Welcome_ButtonBackgroundColor=normalBackground
Welcome_DividerColor=ffd6d6d6
Welcome_HoverColor=fff6f6f6
Welcome_LinkColor=ff5caa15
Welcome_DisabledLinkColor=textDisabled
Timeline_TextColor=text
Timeline_BackgroundColor1=normalBackground

View File

@@ -163,6 +163,7 @@ Welcome_ButtonBackgroundColor=normalBackground
Welcome_DividerColor=ffd6d6d6
Welcome_HoverColor=fff6f6f6
Welcome_LinkColor=ff5caa15
Welcome_DisabledLinkColor=textDisabled
Timeline_TextColor=text
Timeline_BackgroundColor1=normalBackground

View File

@@ -252,6 +252,7 @@ public:
Welcome_DividerColor,
Welcome_LinkColor,
Welcome_HoverColor,
Welcome_DisabledLinkColor,
/* Timeline Library */
Timeline_TextColor,

View File

@@ -336,8 +336,9 @@ public:
const QString &action = actions.at(i);
const int ww = fm.width(action);
const QRect actionRect(xx, yy - 10, ww, 15);
const bool isActive = actionRect.contains(mousePos);
painter->setPen(linkColor);
const bool isForcedDisabled = (i != 0 && sessionName == "default");
const bool isActive = actionRect.contains(mousePos) && !isForcedDisabled;
painter->setPen(isForcedDisabled ? disabledLinkColor : linkColor);
painter->setFont(sizedFont(12, option.widget, isActive));
painter->drawText(xx, yy, action);
if (i < 2) {
@@ -404,6 +405,7 @@ private:
const QColor hoverColor = themeColor(Theme::Welcome_HoverColor);
const QColor textColor = themeColor(Theme::Welcome_TextColor);
const QColor linkColor = themeColor(Theme::Welcome_LinkColor);
const QColor disabledLinkColor = themeColor(Theme::Welcome_DisabledLinkColor);
const QColor backgroundColor = themeColor(Theme::Welcome_BackgroundColor);
const QColor foregroundColor1 = themeColor(Theme::Welcome_ForegroundPrimaryColor); // light-ish.
const QColor foregroundColor2 = themeColor(Theme::Welcome_ForegroundSecondaryColor); // blacker.