From 42b1a1bea247e940f8872d9ea8a8839c1a7b648c Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Tue, 27 Jan 2015 13:57:59 +0300 Subject: [PATCH] home screen --- src/dlangide/ui/frame.d | 3 +++ src/dlangide/ui/homescreen.d | 27 +++++++++++++++++++-------- views/res/i18n/en.ini | 10 +++++----- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 38edfbd..09ce7f1 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -277,6 +277,9 @@ class IDEFrame : AppFrame { wnd.mainWidget = createAboutWidget(); wnd.show(); return true; + case StandardAction.OpenUrl: + platform.openURL(a.stringParam); + return true; case IDEActions.FileOpen: UIString caption; caption = "Open Text File"d; diff --git a/src/dlangide/ui/homescreen.d b/src/dlangide/ui/homescreen.d index f44794c..bbc373e 100644 --- a/src/dlangide/ui/homescreen.d +++ b/src/dlangide/ui/homescreen.d @@ -10,6 +10,8 @@ import dlangide.ui.commands; class HomeScreen : ScrollWidget { protected IDEFrame _frame; protected HorizontalLayout _content; + protected VerticalLayout _startItems; + protected VerticalLayout _recentItems; this(string ID, IDEFrame frame) { super(ID); backgroundColor = 0xFFFFFF; @@ -23,17 +25,26 @@ class HomeScreen : ScrollWidget { _content.addChild(_column1); _content.addChild(_column2); _column1.addChild((new TextWidget(null, "Dlang IDE"d)).fontSize(32).textColor(0x000080)); - _column1.addChild((new TextWidget(null, "D language IDE written in D"d)).fontSize(24)); - _column1.addChild((new TextWidget(null, "(c) Vadim Lopatin 2015"d)).fontSize(24).textColor(0x000080)); + _column1.addChild((new TextWidget(null, "D language IDE written in D"d)).fontSize(20)); + _column1.addChild((new TextWidget(null, "(c) Vadim Lopatin 2015"d)).fontSize(22).textColor(0x000080)); _column1.addChild(new VSpacer()); - _column1.addChild(new TextWidget(null, "Start:"d)); - _column1.addChild(new ImageTextButton(ACTION_FILE_NEW_WORKSPACE)); - _column1.addChild(new ImageTextButton(ACTION_FILE_NEW_PROJECT)); - _column1.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE)); + _column1.addChild((new TextWidget(null, "Start with:"d)).fontSize(20).textColor(0x000040)); + _startItems = new VerticalLayout(); + _recentItems = new VerticalLayout(); + _startItems.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE)); + _startItems.addChild(new ImageTextButton(ACTION_FILE_NEW_WORKSPACE)); + _startItems.addChild(new ImageTextButton(ACTION_FILE_NEW_PROJECT)); + _column1.addChild(_startItems); _column1.addChild(new VSpacer()); - _column1.addChild(new TextWidget(null, "Recent:"d)); + _column1.addChild((new TextWidget(null, "Recent:"d)).fontSize(20).textColor(0x000040)); + _recentItems.addChild((new TextWidget(null, "No recent items"d))); + _column1.addChild(_recentItems); _column1.addChild(new VSpacer()); - _column2.addChild(new TextWidget(null, "Useful links:"d)); + _column2.addChild((new TextWidget(null, "Useful Links:"d)).fontSize(20).textColor(0x000040)); + _column2.addChild(new UrlImageTextButton(null, "D Programming Language"d, "http://dlang.org/")); + _column2.addChild(new UrlImageTextButton(null, "DUB repository"d, "http://code.dlang.org/")); + _column2.addChild(new UrlImageTextButton(null, "DLangUI on GitHub"d, "https://github.com/buggins/dlangui")); + _column2.addChild(new UrlImageTextButton(null, "DLangIDE on GitHub"d, "https://github.com/buggins/dlangide")); _column2.addChild(new VSpacer()); contentWidget = _content; } diff --git a/views/res/i18n/en.ini b/views/res/i18n/en.ini index 37eec02..684f162 100644 --- a/views/res/i18n/en.ini +++ b/views/res/i18n/en.ini @@ -1,11 +1,11 @@ EXIT=Exit MENU_FILE=&FILE MENU_FILE_NEW=&New -MENU_FILE_NEW_SOURCE_FILE=New source file -MENU_FILE_NEW_PROJECT=New project -MENU_FILE_NEW_WORKSPACE=New workspace -MENU_FILE_OPEN=&Open file -MENU_FILE_OPEN_WORKSPACE=Open project or workspace +MENU_FILE_NEW_SOURCE_FILE=New Source File +MENU_FILE_NEW_PROJECT=New Project +MENU_FILE_NEW_WORKSPACE=New Workspace +MENU_FILE_OPEN=&Open file... +MENU_FILE_OPEN_WORKSPACE=Open Project or Workspace... MENU_FILE_OPEN_RECENT=Open recent MENU_FILE_SAVE=&Save file MENU_FILE_SAVE_AS=&Save file as...