Skip to content

Commit

Permalink
remove path label
Browse files Browse the repository at this point in the history
  • Loading branch information
iurienistor committed Feb 23, 2024
1 parent b2838d5 commit 1cb535d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
24 changes: 2 additions & 22 deletions src/file_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ FileDialog::FileDialog(GeonkickWidget *parent,
: GeonkickWidget(parent, type == FileDialog::Type::Browse ? Rk::WindowFlags::Widget : Rk::WindowFlags::Popup)
, dialogType{type}
, filesView{nullptr}
, pathLabel{nullptr}
, status{AcceptStatus::Cancel}
, shortcutDirectoriesModel{new PathListModel(this)}
, shortcutDirectoriesView{new RkList(this, shortcutDirectoriesModel)}
Expand All @@ -412,8 +411,6 @@ FileDialog::FileDialog(GeonkickWidget *parent,
RK_ACT_BIND(filesView, openFile, RK_ACT_ARGS(const std::string &), this, onAccept());
RK_ACT_BIND(filesView, currentFileChanged, RK_ACT_ARGS(const std::string &file),
this, currentFileChanged(file));
RK_ACT_BIND(filesView, currentPathChanged, RK_ACT_ARGS(const std::string &pathName),
this, onPathChanged(pathName));
RK_ACT_BIND(filesView, currentPathChanged, RK_ACT_ARGS(const std::string &pathName),
this, directoryChanged(pathName));
RK_ACT_BIND(shortcutDirectoriesModel,
Expand All @@ -429,17 +426,6 @@ FileDialog::FileDialog(GeonkickWidget *parent,
shortcutDirectoriesView->setSize(100 ,filesView->height());
shortcutDirectoriesView->show();

// Create path label
pathLabel = new RkLabel(this, "Path: " + filesView->getCurrentPath());
pathLabel->setBackgroundColor(background());
pathLabel->setFixedSize(200, 20);
pathLabel->setPosition(filesView->x(), 15);
pathLabel->setFont(font());
pathLabel->setTextColor(textColor());
pathLabel->show();
topContainer->addSpace(shortcutDirectoriesView->width() + 5);
topContainer->addWidget(pathLabel);

createBookmarkDirectoryControls(topContainer);
createNewDirectoryControls(topContainer);

Expand Down Expand Up @@ -482,7 +468,7 @@ FileDialog::FileDialog(GeonkickWidget *parent,

void FileDialog::createBookmarkDirectoryControls(RkContainer *container)
{
container->addSpace(200);
container->addSpace(10);
bookmarkDirectoryButton = new GeonkickButton(this);
bookmarkDirectoryButton->setCheckable(true);
bookmarkDirectoryButton->setSize(16, 16);
Expand Down Expand Up @@ -561,19 +547,13 @@ void FileDialog::createNewDirectoryControls(RkContainer *container)
editingFinished,
RK_ACT_ARGS(),
[=,this](){
editDirectoryName->hide();
editDirectoryName->close();
createDirectoryButton->show();
editDirectoryName->setText("");
container->update();
});
}

void FileDialog::onPathChanged(const std::string &pathName)
{
if (!pathName.empty())
pathLabel->setText("Path: " + pathName);
}

void FileDialog::onAccept()
{
status = AcceptStatus::Accept;
Expand Down
3 changes: 0 additions & 3 deletions src/file_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class RkPaintEvent;
class RkMouseEvent;
class RkCloseEvent;
class GeonkickButton;
class RkLabel;
class GeonkickSlider;
class PathListModel;
class RkList;
Expand Down Expand Up @@ -138,14 +137,12 @@ class FileDialog: public GeonkickWidget {
void updateBookmarkButton(const std::filesystem::path &path);
void onAccept();
void onCancel();
void onPathChanged(const std::string &pathName);
void closeEvent(RkCloseEvent *event) final;

private:
RkLineEdit *fileNameEdit;
Type dialogType;
FilesView *filesView;
RkLabel *pathLabel;
std::string pathSelected;
AcceptStatus status;
PathListModel* shortcutDirectoriesModel;
Expand Down
4 changes: 2 additions & 2 deletions src/redkite/src/RkLineEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ void RkLineEdit::focusEvent(RkFocusEvent* event)
} else if (event->type() == RkEvent::Type::FocusedOut) {
RK_LOG_DEBUG("RkEvent::Type::FocusedOut");
if (impl_ptr->hasEditFocus())
action editingFinished();
hideCursor();
action editingFinished();
hideCursor();
}
}

Expand Down

0 comments on commit 1cb535d

Please sign in to comment.