Skip to content

Commit

Permalink
Shell: Moving resources to the package
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 3, 2019
1 parent 63c814c commit e573b3b
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 16 deletions.
10 changes: 10 additions & 0 deletions doomsday/tools/shell/net.dengine.shell.pack/images.dei
@@ -0,0 +1,10 @@
script { import gui }

image logo { path $= gui.dpiScaledImagePath("images/shell.png") }

toolbar {
image console { path $= gui.dpiScaledImagePath("images/toolbar_console.png") }
image options { path $= gui.dpiScaledImagePath("images/toolbar_options.png") }
image status { path $= gui.dpiScaledImagePath("images/toolbar_status.png") }
image placeholder { path $= gui.dpiScaledImagePath("images/toolbar_placeholder.png") }
}
File renamed without changes
File renamed without changes
14 changes: 0 additions & 14 deletions doomsday/tools/shell/res/shell.qrc

This file was deleted.

17 changes: 16 additions & 1 deletion doomsday/tools/shell/src/aboutdialog.cpp
Expand Up @@ -5,13 +5,28 @@
//#include <QDialogButtonBox>
//#include <QVBoxLayout>
//#include <QPushButton>
#include <de/LabelWidget>

using namespace de;

AboutDialog::AboutDialog()
{
title().setText("Doomsday Shell");
// AutoRef<Rule> width = rule("unit") * 100;

title().setText("Doomsday Shell");
buttons() << new ButtonItem(Default | Accept, "OK");

auto *logo = new LabelWidget;
logo->setImage(GuiShellApp::imageBank().image("logo"));
logo->rule().setInput(Rule::Height, logo->rule().width());

area().add(logo);

updateLayout();

// setLayoutWidth(width);


// QVBoxLayout *box = new QVBoxLayout;
// setLayout(box);
// box->setSizeConstraint(QLayout::SetFixedSize);
Expand Down
9 changes: 8 additions & 1 deletion doomsday/tools/shell/src/guishellapp.cpp
Expand Up @@ -49,6 +49,7 @@ DE_PIMPL(GuiShellApp)
std::unique_ptr<ShellWindowSystem> winSys;
ServerFinder finder;

ImageBank imageBank;
// QMenuBar *menuBar;
// QMenu *localMenu;
PopupMenuWidget *localMenu;
Expand All @@ -65,7 +66,7 @@ DE_PIMPL(GuiShellApp)
Impl(Public *i) : Base(i), prefs(nullptr)
{
// localCheckTimer.setInterval(1000);
// localCheckTimer.setSingleShot(false);
// localCheckTimer.setSingleShot(false);
}

~Impl()
Expand Down Expand Up @@ -154,6 +155,7 @@ void GuiShellApp::initialize()
d->winSys.reset(new ShellWindowSystem);
addSystem(*d->winSys);

d->imageBank.addFromInfo(FS::locate<const File>("/packs/net.dengine.shell/images.dei"));
d->loadAllShaders();
}

Expand Down Expand Up @@ -416,3 +418,8 @@ void GuiShellApp::checkLocalServers()
// }
// }
}

ImageBank &GuiShellApp::imageBank()
{
return app().d->imageBank;
}
2 changes: 2 additions & 0 deletions doomsday/tools/shell/src/guishellapp.h
Expand Up @@ -20,6 +20,7 @@
#define GUISHELLAPP_H

#include <de/BaseGuiApp>
#include <de/ImageBank>
#include <de/PopupMenuWidget>
#include <de/ServerFinder>

Expand All @@ -36,6 +37,7 @@ class GuiShellApp : public de::BaseGuiApp
de::ServerFinder &serverFinder();

static GuiShellApp &app();
static de::ImageBank &imageBank();
de::PopupMenuWidget &localServersMenu();
// de::PopupMenuWidget *makeHelpMenu();

Expand Down

0 comments on commit e573b3b

Please sign in to comment.