summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-22 21:38:58 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-22 21:38:58 +0200
commita6b153abf19013b8a23f04ca37cda737d127ab6f (patch)
tree78abcfa1bd2967dc1088a71b1c680a03773c58bc /DevTools
parent31b504789431d48feb67d8c6c79cc98d4d7df4f0 (diff)
downloadserenity-a6b153abf19013b8a23f04ca37cda737d127ab6f.zip
HackStudio: Show the currently open file in bold (in the project list)
Also import a little default C++ project called "little" :^)
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/HackStudio/Project.cpp6
-rw-r--r--DevTools/HackStudio/main.cpp9
2 files changed, 13 insertions, 2 deletions
diff --git a/DevTools/HackStudio/Project.cpp b/DevTools/HackStudio/Project.cpp
index d1a4da35d1..30acbc7729 100644
--- a/DevTools/HackStudio/Project.cpp
+++ b/DevTools/HackStudio/Project.cpp
@@ -16,6 +16,12 @@ public:
if (role == Role::Display) {
return m_project.m_files.at(row);
}
+ if (role == Role::Font) {
+ extern String g_currently_open_file;
+ if (m_project.m_files.at(row) == g_currently_open_file)
+ return Font::default_bold_font();
+ return {};
+ }
return {};
}
virtual void update() override {}
diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp
index 52b3dd1e41..eabfd0e122 100644
--- a/DevTools/HackStudio/main.cpp
+++ b/DevTools/HackStudio/main.cpp
@@ -19,6 +19,8 @@
#include <stdio.h>
#include <unistd.h>
+String g_currently_open_file;
+
int main(int argc, char** argv)
{
GApplication app(argc, argv);
@@ -34,11 +36,11 @@ int main(int argc, char** argv)
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
widget->layout()->set_spacing(0);
- if (chdir("/home/anon/serenity") < 0) {
+ if (chdir("/home/anon/little") < 0) {
perror("chdir");
return 1;
}
- auto project = Project::load_from_file("serenity.files");
+ auto project = Project::load_from_file("little.files");
ASSERT(project);
auto toolbar = GToolBar::construct(widget);
@@ -61,6 +63,9 @@ int main(int argc, char** argv)
return;
}
text_editor->set_text(file->read_all());
+ g_currently_open_file = filename;
+ window->set_title(String::format("%s - HackStudio", g_currently_open_file.characters()));
+ project_list_view->update();
};
auto terminal_wrapper = TerminalWrapper::construct(inner_splitter);