Skip to content

Commit

Permalink
App: Handle overflowing text better
Browse files Browse the repository at this point in the history
  • Loading branch information
tallbl0nde committed Jul 25, 2021
1 parent 2ebea6c commit 3acaa9e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Application/libs/Aether
Submodule Aether updated 39 files
+2 −2 docs/AsyncItem_8hpp_source.html
+1 −1 docs/BorderButton_8hpp_source.html
+1 −1 docs/Box_8hpp_source.html
+5 −3 docs/Drawable_8hpp_source.html
+1 −1 docs/Element_8hpp_source.html
+1 −1 docs/Ellipse_8hpp_source.html
+1 −1 docs/FilledButton_8hpp_source.html
+1 −1 docs/HelpButton_8hpp_source.html
+1 −1 docs/Rectangle_8hpp_source.html
+4 −2 docs/Renderer_8hpp_source.html
+1 −1 docs/Scrollable_8hpp_source.html
+1 −1 docs/TextBlock_8hpp_source.html
+1 −1 docs/Text_8hpp_source.html
+1 −1 docs/Texture_8hpp_source.html
+1 −1 docs/Window_8hpp_source.html
+43 −43 docs/classAether_1_1AsyncItem-members.html
+31 −4 docs/classAether_1_1AsyncItem.html
+8 −7 docs/classAether_1_1Drawable-members.html
+23 −0 docs/classAether_1_1Drawable.html
+2 −0 docs/classAether_1_1Renderer-members.html
+60 −0 docs/classAether_1_1Renderer.html
+0 −3 docs/functions_0x7e.html
+0 −3 docs/functions_func_0x7e.html
+3 −0 docs/functions_func_g.html
+8 −1 docs/functions_func_r.html
+3 −0 docs/functions_g.html
+8 −1 docs/functions_r.html
+1 −1 docs/primary_2Image_8hpp_source.html
+3 −1 docs/search/all_10.js
+1 −1 docs/search/all_12.js
+0 −1 docs/search/all_19.js
+1 −0 docs/search/all_6.js
+1 −1 docs/search/functions_11.js
+0 −1 docs/search/functions_17.js
+1 −0 docs/search/functions_6.js
+3 −1 docs/search/functions_f.js
+2 −2 include/Aether/horizon/button/FilledButton.hpp
+14 −4 source/horizon/button/BorderButton.cpp
+13 −3 source/horizon/button/FilledButton.cpp
12 changes: 4 additions & 8 deletions Application/source/ui/frame/AlbumInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,33 @@ namespace Frame {
this->bottomContainer->addElement(this->image);

// Fetch image (id3 tags)
Aether::BorderButton * button = new Aether::BorderButton(txt->x(), this->imagePath->y() + this->imagePath->h() + 20, this->w() * 0.3, 50, 2, "", 20, [this]() {
Aether::BorderButton * button = new Aether::BorderButton(txt->x(), this->imagePath->y() + this->imagePath->h() + 20, this->w() * 0.3, 50, 2, "Common.ReplaceFile"_lang, 20, [this]() {
this->createFileBrowser(FBType::Audio);
});
button->setString("Common.ReplaceFile"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);

// Fetch image (local image)
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "Common.ReplaceSD"_lang, 20, [this]() {
this->createFileBrowser(FBType::Image);
});
button->setString("Common.ReplaceSD"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);

// Fetch image (TheAudioDB)
button = new Aether::BorderButton(txt->x(), button->y() + button->h() + 20, this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(txt->x(), button->y() + button->h() + 20, this->w() * 0.3, 50, 2, "Common.ReplaceAudioDB"_lang, 20, [this]() {
this->createAudioDBOverlay();
});
button->setString("Common.ReplaceAudioDB"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);

// Remove image
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "Common.RemoveImage"_lang, 20, [this]() {
this->removeImage();
});
button->setString("Common.RemoveImage"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);
Expand Down
9 changes: 3 additions & 6 deletions Application/source/ui/frame/ArtistInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,26 @@ namespace Frame {

// Fetch image (local)
Aether::Container * c = new Aether::Container(txt->x(), this->imagePath->y() + this->imagePath->h() + 20, this->w()*0.62, 50);
Aether::BorderButton * button = new Aether::BorderButton(c->x(), c->y(), this->w() * 0.3, 50, 2, "", 20, [this]() {
Aether::BorderButton * button = new Aether::BorderButton(c->x(), c->y(), this->w() * 0.3, 50, 2, "Common.ReplaceSD"_lang, 20, [this]() {
this->createFileBrowser();
});
button->setString("Common.ReplaceSD"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
c->addElement(button);

// Fetch image (TheAudioDB)
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "Common.ReplaceAudioDB"_lang, 20, [this]() {
this->createAudioDBOverlay();
});
button->setString("Common.ReplaceAudioDB"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
c->addElement(button);
this->bottomContainer->addElement(c);

// Remove image
button = new Aether::BorderButton(txt->x() + this->w()*0.16, button->y() + button->h() + 20, this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(txt->x() + this->w()*0.16, button->y() + button->h() + 20, this->w() * 0.3, 50, 2, "Common.RemoveImage"_lang, 20, [this]() {
this->removeImage();
});
button->setString("Common.RemoveImage"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);
Expand Down
9 changes: 3 additions & 6 deletions Application/source/ui/frame/PlaylistInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,25 @@ namespace Frame {
this->bottomContainer->addElement(this->image);

// Fetch image (id3 tags)
Aether::BorderButton * button = new Aether::BorderButton(txt->x(), this->imagePath->y() + this->imagePath->h() + 20, this->w() * 0.3, 50, 2, "", 20, [this]() {
Aether::BorderButton * button = new Aether::BorderButton(txt->x(), this->imagePath->y() + this->imagePath->h() + 20, this->w() * 0.3, 50, 2, "Common.ReplaceFile"_lang, 20, [this]() {
this->createFileBrowser(FBType::Audio);
});
button->setString("Common.ReplaceFile"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);

// Fetch image (local image)
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(button->x() + button->w() + this->w()*0.02, button->y(), this->w() * 0.3, 50, 2, "Common.ReplaceSD"_lang, 20, [this]() {
this->createFileBrowser(FBType::Image);
});
button->setString("Common.ReplaceSD"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);

// Remove image
button = new Aether::BorderButton(button->x() - this->w()*0.16, button->y() + button->h() + 20, this->w() * 0.3, 50, 2, "", 20, [this]() {
button = new Aether::BorderButton(button->x() - this->w()*0.16, button->y() + button->h() + 20, this->w() * 0.3, 50, 2, "Common.RemoveImage"_lang, 20, [this]() {
this->removeImage();
});
button->setString("Common.RemoveImage"_lang);
button->setBorderColour(this->app->theme()->FG());
button->setTextColour(this->app->theme()->FG());
this->bottomContainer->addElement(button);
Expand Down
2 changes: 0 additions & 2 deletions Application/source/ui/screen/Home.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ namespace Screen {
int maxW = this->backButton->w() - 70 - this->backIcon->w();
this->backText = new Aether::Text(0, 0, "Common.Back"_lang, 26);
while (this->backText->textureWidth() > maxW) {
// TODO: Fix
// This renders the text each time but should be fine :P
this->backText->setFontSize(this->backText->fontSize()-2);
}
Expand All @@ -496,7 +495,6 @@ namespace Screen {
maxW = quitButton->w() - 70 - quitIcon->w();
Aether::Text * quitText = new Aether::Text(0, 0, "Common.Quit"_lang, 26);
while (quitText->textureWidth() > maxW) {
// TODO: Fix
// This renders the text each time but should be fine :P
quitText->setFontSize(quitText->fontSize()-2);
}
Expand Down

0 comments on commit 3acaa9e

Please sign in to comment.