Skip to content

Commit

Permalink
Merge branch 'Huntereb-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
HookedBehemoth committed Sep 22, 2019
2 parents 6408b61 + d674ba3 commit 0dc7dc5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# screen-nx
upload screenshots directly from your switch
Upload screenshots directly to Lewd.pics from your switch
Binary file added romfs/video.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions source/ListLayout.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ ListLayout::ListLayout() {
this->owo->SetHeight(480);
this->menu = elm::Menu::New(0,40,980,theme.RED,136,5,45);
this->menu->SetOnFocusColor(theme.DRED);
for (auto &f: getDirectoryFiles(path, {".jpg", ".png"})){
for (auto &f: getDirectoryFiles(path, {".jpg", ".png", ".mp4"})){
filePaths->push_back(f);
auto itm = elm::MenuItem::New(f.filename().string().substr(0,12).insert(10,":").insert(8," ").insert(6,".").insert(4,"."));
itm->SetColor(theme.WHITE);
itm->SetIcon(f.string());
if (f.filename().extension() == ".mp4") itm->SetIcon("romfs:/video.png");
else itm->SetIcon(f.string());
itm->AddOnClick(std::bind(&ListLayout::onItemClick, this));
menu->AddItem(itm);
}
Expand All @@ -48,4 +49,4 @@ ListLayout::ListLayout() {
void ListLayout::onItemClick() {
std::string path = (*filePaths)[this->menu->GetSelectedIndex()];
mainApp->upload(path);
}
}
4 changes: 2 additions & 2 deletions source/MainApplication.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ void MainApplication::onInput_upload(u64 Down, u64 Up, u64 Held) {
this->uploadLayout->showUrl(url);
this->uploadLayout->SetOnInput(std::bind(&MainApplication::onInput_back, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
} else {
this->uploadLayout->showUrl("FAILED!");
this->uploadLayout->showUrl("Upload failed!");
}
}
}
void MainApplication::onInput_back(u64 Down, u64 Up, u64 Held) {
if(Down & KEY_B) {
list();
}
}
}
7 changes: 4 additions & 3 deletions source/UploadLayout.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ UploadLayout::UploadLayout() {
this->topRect = elm::Rectangle::New(0,0,1280,30,theme.TOPBAR);
this->text = elm::TextBlock::New(10,0,"Lewd.pics",25);
this->text->SetColor(theme.WHITE);
this->url = elm::TextBlock::New(80,640,"",45);
this->url = elm::TextBlock::New(80,640,"Press A to upload, B to go back!",45);
this->url->SetColor(theme.WHITE);
this->screenShot = elm::Image::New(10,40,path);
if (path.find(".mp4") != std::string::npos) this->screenShot = elm::Image::New(10,40,"romfs:/video.png");
else this->screenShot = elm::Image::New(10,40,path);
this->screenShot->SetWidth(970);
this->screenShot->SetHeight(545);
this->owo = elm::Image::New(989,240,"romfs:/owo.png");
Expand All @@ -40,4 +41,4 @@ UploadLayout::UploadLayout() {
}
void UploadLayout::showUrl(std::string url) {
this->url->SetText(url);
}
}

0 comments on commit 0dc7dc5

Please sign in to comment.