Commit e02213e7 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

make welcome page fully translatable

... by eliminating images containing text.
of course, this causes some stylistic issues. oh, well.
parent dfd0c9f9
......@@ -44,14 +44,13 @@
<file>images/unlocked.png</file>
<file>images/extension.png</file>
<file>images/darkclosebutton.png</file>
<file>images/welcomemode/btn_feedback.png</file>
<file>images/welcomemode/btn_feedback_hover.png</file>
<file>images/welcomemode/btn_getting_started.png</file>
<file>images/welcomemode/btn_getting_started_hover.png</file>
<file>images/welcomemode/btn_restore_session.png</file>
<file>images/welcomemode/btn_restore_session_hover.png</file>
<file>images/welcomemode/btn_26.png</file>
<file>images/welcomemode/btn_26_hover.png</file>
<file>images/welcomemode/btn_27.png</file>
<file>images/welcomemode/btn_27_hover.png</file>
<file>images/welcomemode/feedback_arrow.png</file>
<file>images/welcomemode/feedback_arrow_hover.png</file>
<file>images/welcomemode/feedback-bar-background.png</file>
<file>images/welcomemode/feedback-text.png</file>
<file>images/welcomemode/list_bullet_arrow.png</file>
<file>images/welcomemode/mode_project.png</file>
<file>images/welcomemode/nokia_logo.png</file>
......
......@@ -227,7 +227,8 @@ void WelcomeMode::slotFeedback()
WelcomeModeButton::WelcomeModeButton(QWidget *parent) :
QLabel(parent),
m_isPressed(false)
m_isPressed(false),
m_isInited(false)
{
setCursor(QCursor(Qt::PointingHandCursor));
}
......@@ -247,6 +248,28 @@ void WelcomeModeButton::mouseReleaseEvent(QMouseEvent *event)
}
}
void WelcomeModeButton::enterEvent(QEvent *)
{
if (!m_isInited) {
m_isInited = true;
m_text = text();
m_hoverText = m_text;
m_hoverText.replace(QLatin1String(".png"), QLatin1String("_hover.png"));
if (m_text == m_hoverText) {
m_text.clear();
m_hoverText.clear();
}
}
if (!m_hoverText.isEmpty())
setText(m_hoverText);
}
void WelcomeModeButton::leaveEvent(QEvent *)
{
if (!m_text.isEmpty())
setText(m_text);
}
// --- WelcomeModeTreeWidget
WelcomeModeTreeWidget::WelcomeModeTreeWidget(QWidget *parent) :
......
......@@ -164,22 +164,25 @@ p {
</item>
<item>
<widget class="Core::Internal::WelcomeModeButton" name="gettingStartedButton">
<property name="minimumSize">
<size>
<width>133</width>
<height>29</height>
</size>
</property>
<property name="styleSheet">
<string>* {
background-image: url(&quot;:/core/images/welcomemode/btn_getting_started.png&quot;);
border-image: url(:/core/images/welcomemode/btn_27.png) 7;
border-width: 7;
padding: -2px 0;
font-size: 12px;
font-family: lucida sans, dejavu sans, sans serif;
color: black;
}
*:hover {
background-image: url(:/core/images/welcomemode/btn_getting_started_hover.png)
border-image: url(:/core/images/welcomemode/btn_27_hover.png) 7;
color: white;
}
</string>
</property>
<property name="text">
<string>&lt;qt&gt;Getting Started &amp;gt;&amp;gt;</string>
</property>
</widget>
</item>
</layout>
......@@ -281,45 +284,6 @@ h2 {
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="restoreButtonSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="Core::Internal::WelcomeModeButton" name="restoreSessionButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>137</width>
<height>27</height>
</size>
</property>
<property name="styleSheet">
<string>* {
background-image: url(&quot;:/core/images/welcomemode/btn_restore_session.png&quot;);
}
*:hover {
background-image: url(:/core/images/welcomemode/btn_restore_session_hover.png)
}
</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="Core::Internal::WelcomeModeTreeWidget" name="sessTreeWidget">
<property name="sizePolicy">
......@@ -374,7 +338,7 @@ h2 {
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_2">
<spacer name="restoreButtonVerticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
......@@ -386,6 +350,45 @@ h2 {
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="Core::Internal::WelcomeModeButton" name="restoreSessionButton">
<property name="styleSheet">
<string>* {
border-image: url(:/core/images/welcomemode/btn_26.png) 7;
border-width: 7;
padding: -2px 0;
font-size: 12px;
font-family: lucida sans, dejavu sans, sans serif;
color: black;
}
*:hover {
border-image: url(:/core/images/welcomemode/btn_26_hover.png) 7;
color: white;
}
</string>
</property>
<property name="text">
<string>&lt;qt&gt;Restore Last Session &amp;gt;&amp;gt;</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="restoreButtonSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Ignored</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
......@@ -711,45 +714,31 @@ background-image: url(:/core/images/welcomemode/feedback-bar-background.png);
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
<number>10</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0" rowspan="3">
<widget class="QLabel" name="feedbackLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/feedback-text.png</pixmap>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Core::Internal::WelcomeModeButton" name="feedbackButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>102</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string>* {
background-image: url(&quot;:/core/images/welcomemode/btn_feedback.png&quot;);
border-image: url(:/core/images/welcomemode/btn_26.png) 7;
border-width: 7;
padding: -2px 2px;
font-size: 12px;
font-family: lucida sans, dejavu sans, sans serif;
}
*:hover {
background-image: url(:/core/images/welcomemode/btn_feedback_hover.png)
border-image: url(:/core/images/welcomemode/btn_26_hover.png) 7;
color: white;
}
</string>
</property>
<property name="text">
<string>&lt;qt&gt;Feedback&amp;nbsp;&amp;nbsp;&lt;img src=&quot;:/core/images/welcomemode/feedback_arrow.png&quot; /&gt;</string>
</property>
</widget>
</item>
<item row="1" column="2">
......@@ -771,7 +760,7 @@ background-image: url(:/core/images/welcomemode/feedback-bar-background.png);
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
......@@ -787,16 +776,23 @@ background-image: url(:/core/images/welcomemode/feedback-bar-background.png);
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>0</height>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="helpUsLabel">
<property name="text">
<string>Help us make Qt Creator even better</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -50,9 +50,14 @@ signals:
protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void enterEvent(QEvent *event);
virtual void leaveEvent(QEvent *event);
private:
bool m_isPressed;
bool m_isInited;
QString m_text;
QString m_hoverText;
};
class WelcomeModeTreeWidget : public QTreeWidget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment