Skip to content

Commit 995f620

Browse files
committed
better about window
1 parent af31409 commit 995f620

File tree

3 files changed

+39
-64
lines changed

3 files changed

+39
-64
lines changed

resources/gui/mainWindow/mainWindow.rml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<template src="sideBar"></template>
2424
</div>
2525

26-
2726
<!-- <div id="center-container"> -->
2827
<div id="circuit-view-container">
2928
<template src="circuitView"></template>

resources/gui/mainWindow/popUpWindow/popUpWindow.rcss

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
}
3030

3131
.pop-up-window-blocked {
32-
width: 50%;
33-
min-width: 500dp;
34-
}
35-
36-
.pop-up-window-blocked-bug-report {
37-
width: 50%;
38-
min-width: 500dp;
32+
min-width: 300dp;
3933
}
4034

4135
.pop-up-window-not-blocked {
@@ -104,18 +98,3 @@
10498
.pop-up-textarea:focus {
10599
border: 1dp #d1963a;
106100
}
107-
108-
/* .pop-up-input {
109-
width: 100%;
110-
height: 30dp;
111-
font-size: 14dp;
112-
padding: 6dp 8dp;
113-
border-radius: 4dp;
114-
background-color: #2a2a2a;
115-
color: #c9c9c9;
116-
border: 1dp #6a4d28;
117-
}
118-
119-
.pop-up-input:focus {
120-
border: 1dp #d1963a;
121-
} */

src/gui/mainWindow/popUps/popUpManager.cpp

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -165,76 +165,75 @@ void PopUpManager::aboutConnectionMachine() {
165165
if (!optionalPopUpWindow) return;
166166
PopUpWindow popUpWindow = std::move(optionalPopUpWindow.value());
167167

168-
popUpWindow.getPopUpWindow()->SetAttribute("style", "display: flex; flex-direction: column; width: 650px; height: 500px; background-color:#303030;");
168+
popUpWindow.getPopUpWindow()->SetAttribute("style", "display: flex; flex-direction: column; width: 480dp; height: 320dp; background-color:#303030;");
169169
Rml::Element* leftandright = popUpWindow.getPopUpWindow()->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
170-
leftandright->SetAttribute("style", "display: flex; flex-direction: row; width: 650px; height: 500px; background-color:#303030;");
171-
172-
Rml::Element* leftbuffer = leftandright->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
173-
leftbuffer->SetAttribute("style", "display: flex; flex-direction: column; width: 20px; height: 300px; background-color:#303030;");
170+
leftandright->SetAttribute("style", "display: flex; flex-direction: row; width: 100%; height: 100%;");
174171

175172
Rml::Element* leftdiv = leftandright->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
176-
leftdiv->SetAttribute("style", "display: flex; flex-direction: column; width: 450px; height: 300px; background-color:#303030;");
173+
leftdiv->SetAttribute("style", "display: flex; flex-direction: column; flex: 1; height: 100%; padding-right: 20dp;");
177174

178175
Rml::Element* title = leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("p"));
179176
title->SetInnerRML("About Connection Machine");
177+
title->SetAttribute("style", "font-size: 18dp;");
180178
title->SetClass("popup-title", true);
181179

180+
leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"))->SetAttribute("style", "height: 10dp;");
181+
182182
Rml::Element* body = leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("p"));
183183
body->SetInnerRML("Connection Machine is an open source project aiming to create an application for designing and simulating logic graph systems.");
184-
body->SetClass("popup-title", true);
184+
body->SetAttribute("style", "padding: 5dp; border-radius: 5dp;");
185+
body->SetClass("surface-raised", true);
185186

186-
Rml::Element* body2 = leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("p"));
187-
body2->SetInnerRML(
188-
"<br /> github: https://github.com/Martian-Technologies/<br />Connection-Machine <br /> \
189-
website: https://connection-machine.com "
190-
);
191-
body2->SetClass("popup-title", true);
187+
leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"))->SetAttribute("style", "height: 10dp;");
188+
189+
Rml::Element* links = leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
190+
links->SetAttribute("style", "padding: 5dp; border-radius: 4dp; display: flex; flex-direction: column;");
191+
links->SetClass("surface-raised", true);
192+
193+
Rml::Element* gitHubLink = links->AppendChild(mainWindow.getRmlDocument()->CreateElement("p"));
194+
gitHubLink->SetInnerRML("GitHub: <p style=\"color: #6969ffff\">github.com/Connection-Machine</p>");
195+
gitHubLink->AddEventListener(Rml::EventId::Click, new EventPasser([](Rml::Event& event){
196+
SDL_OpenURL("https://github.com/Martian-Technologies/Connection-Machine");
197+
}));
198+
199+
links->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"))->SetAttribute("style", "height: 8dp;");
192200

201+
Rml::Element* website = links->AppendChild(mainWindow.getRmlDocument()->CreateElement("p"));
202+
website->SetInnerRML("Website: <p style=\"color: #6969ffff\">connection-machine.com</p>");
203+
website->AddEventListener(Rml::EventId::Click, new EventPasser([](Rml::Event& event){
204+
SDL_OpenURL("https://connection-machine.com");
205+
}));
193206

194-
Rml::Element* rightbuffer = leftandright->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
195-
rightbuffer->SetAttribute("style", "display: flex; flex-direction: column; width: 30px; height: 300px; background-color:#303030;");
207+
leftdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"))->SetAttribute("style", "flex: 1");
196208

197209
Rml::Element* rightdiv = leftandright->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
198-
rightdiv->SetAttribute("style", "display: flex; flex-direction: column; width: 150px; height: 450px; background-color:#303030;");
210+
rightdiv->SetAttribute("style", "display: flex; flex-direction: column; width: 144dp; height: 100%; background-color:#303030;");
199211

200212
// Add a logo (adjust the src path to your actual asset)
201213
Rml::Element* logo = rightdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("img"));
202214
logo->SetAttribute("src", "../../gateIcon.png");
203-
logo->SetAttribute("style", "width: 100px; height: 100px; margin-bottom: 20px;");
215+
logo->SetAttribute("style", "margin-left: 15%; margin-right: 15%; margin-bottom: 5%; width: 108dp; height: 108dp;");
204216

205217
// Add contributor names
206218
Rml::Element* contributorsTitle = rightdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("p"));
207219
contributorsTitle->SetInnerRML("Contributors:");
208220
contributorsTitle->SetClass("popup-subtitle", true);
209221

210-
Rml::Element* contributorsList = rightdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("ul"));
222+
Rml::Element* rightdivScrollArea = rightdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
223+
rightdivScrollArea->SetAttribute("style", "position: relative; flex-grow: 1; border-radius: 8dp; background-color:#3b3b3b;");
224+
Rml::Element* rightdivScroll = rightdivScrollArea->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
211225

212226
std::vector<std::string> contributors = {
213-
"Ben Herman",
214-
"Nikita Lurye",
215-
"Jack J",
216-
"Connor K",
217-
"James P",
218-
"Gregory L",
219-
"Sam C",
220-
"August B",
221-
"Nick C",
222-
"Matthew D",
223-
"Dante L",
224-
"Tiffany C",
225-
"Patrick C",
226-
"Nathan C",
227-
"Alek K "
227+
"Ben Herman", "Nikita Lurye", "Jack Jamison", "Connor Kostiew", "James P", "Gregory Lemonnier", "Sam C", "Alek Krupka",
228+
"August Bernberg", "Nicholas Ciuica", "Matthew Durcan", "Tiffany C", "Patrick Chen", "Nathan Chen", "Dante L"
228229
};
229230

230-
// Rml::Element* contributorsList = rightdiv->AppendChild(mainWindow.getRmlDocument()->CreateElement("li"));
231231
std::string all_contributors = "";
232232
for (const auto& name : contributors){
233-
all_contributors = all_contributors + name.c_str() + "<br />";
233+
all_contributors = all_contributors + "<p>" + name.c_str() + "</p>";
234234
}
235-
contributorsList->SetInnerRML(all_contributors);
236-
contributorsList->SetAttribute("style", "margin: 4px 0;");
237-
235+
rightdivScroll->SetInnerRML(all_contributors);
236+
rightdivScroll->SetAttribute("style", "position: absolute; top: 0; bottom: 0; width: 100%; overflow-y: scroll; display: flex; flex-direction: column; color: #d1963a; padding: 8dp;");
238237

239238
Rml::Element* close = popUpWindow.getPopUpWindow()->AppendChild(mainWindow.getRmlDocument()->CreateElement("button"));
240239
close->SetInnerRML("Close");
@@ -272,7 +271,7 @@ void PopUpManager::addFeedbackPopup() { // feature request, bug report, feature
272271
textarea->SetClass("surface-pop", true);
273272

274273
Rml::Element* includeStateField = content->AppendChild(mainWindow.getRmlDocument()->CreateElement("div"));
275-
includeStateField->SetAttribute("style", "display: flex; align-items: flex-start; gap: 0.5em; padding: 0.6em; border-radius: 8px; background-color: #262626;");
274+
includeStateField->SetAttribute("style", "display: flex; align-items: flex-start; gap: 0.5em; padding: 0.6em; border-radius: 8dp; background-color: #262626;");
276275
Rml::Element* includeStateCheckbox = includeStateField->AppendChild(mainWindow.getRmlDocument()->CreateElement("input"));
277276
includeStateCheckbox->SetAttribute("type", "checkbox");
278277
includeStateCheckbox->SetAttribute("id", "feedback_include_state");
@@ -327,6 +326,4 @@ void PopUpManager::addFeedbackPopup() { // feature request, bug report, feature
327326
popUpWindow.destroy();
328327
})
329328
);
330-
331-
// App::get().launchRmlDebugger(popUpWindow.getContext());
332329
}

0 commit comments

Comments
 (0)