adopt code to new imgui and new sdl
This commit is contained in:
parent
ca6909b64a
commit
a15a9af2b3
@ -229,7 +229,8 @@ void FileSelector::render(void) {
|
|||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("X cancel", {ImGui::GetWindowContentRegionWidth()/2.f, TEXT_BASE_HEIGHT*2})) {
|
//if (ImGui::Button("X cancel", {ImGui::GetWindowContentRegionWidth()/2.f, TEXT_BASE_HEIGHT*2})) {
|
||||||
|
if (ImGui::Button("X cancel", {ImGui::GetContentRegionAvail().x/2.f, TEXT_BASE_HEIGHT*2})) {
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
_on_cancel();
|
_on_cancel();
|
||||||
reset();
|
reset();
|
||||||
|
@ -73,8 +73,8 @@ MainScreen::~MainScreen(void) {
|
|||||||
|
|
||||||
bool MainScreen::handleEvent(SDL_Event& e) {
|
bool MainScreen::handleEvent(SDL_Event& e) {
|
||||||
if (e.type == SDL_EVENT_DROP_FILE) {
|
if (e.type == SDL_EVENT_DROP_FILE) {
|
||||||
std::cout << "DROP FILE: " << e.drop.file << "\n";
|
std::cout << "DROP FILE: " << e.drop.data << "\n";
|
||||||
cg.sendFilePath(e.drop.file);
|
cg.sendFilePath(e.drop.data);
|
||||||
_render_interval = 1.f/60.f; // TODO: magic
|
_render_interval = 1.f/60.f; // TODO: magic
|
||||||
_time_since_event = 0.f;
|
_time_since_event = 0.f;
|
||||||
return true; // TODO: forward return succ from sendFilePath()
|
return true; // TODO: forward return succ from sendFilePath()
|
||||||
|
@ -445,7 +445,8 @@ void SendImagePopup::render(float time_delta) {
|
|||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("X cancel", {ImGui::GetWindowContentRegionWidth()/2.f, TEXT_BASE_HEIGHT*2})) {
|
//if (ImGui::Button("X cancel", {ImGui::GetWindowContentRegionWidth()/2.f, TEXT_BASE_HEIGHT*2})) {
|
||||||
|
if (ImGui::Button("X cancel", {ImGui::GetContentRegionAvail().x/2.f, TEXT_BASE_HEIGHT*2})) {
|
||||||
_on_cancel();
|
_on_cancel();
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
reset();
|
reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user