Tracker: tweak FindPanel layout again

- Remove the "more options" latch
- Put the icon back on the left.

Fixes #16015
This commit is contained in:
Adrien Destugues
2020-05-16 20:01:10 +02:00
parent 9094f0c24f
commit 56788ad98b
2 changed files with 10 additions and 25 deletions
+7 -23
View File
@@ -50,6 +50,7 @@ All rights reserved.
#include <Catalog.h>
#include <CheckBox.h>
#include <ControlLook.h>
#include <Cursor.h>
#include <Debug.h>
#include <Directory.h>
#include <FindDirectory.h>
@@ -779,6 +780,8 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
fDraggableIcon->SetExplicitMaxSize(
BSize(draggableRect.right - draggableRect.left,
draggableRect.bottom - draggableRect.top));
BCursor grabCursor(B_CURSOR_ID_GRAB);
fDraggableIcon->SetViewCursor(&grabCursor);
}
fQueryName = new BTextControl("query name", B_TRANSLATE("Query name:"),
@@ -805,14 +808,6 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
.End()
.View());
fLatch = new PaneSwitch("optionsLatch", true, B_WILL_DRAW);
fLatch->SetLabels(B_TRANSLATE("Fewer options"), B_TRANSLATE("More options"));
fLatch->SetValue(0);
fLatch->SetMessage(new BMessage(kLatchChanged));
fLatch->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_VERTICAL_CENTER));
fMoreOptions->Hide();
// add Search button
BButton* button;
if (editTemplateOnly) {
@@ -864,14 +859,13 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
.Add(queryBox)
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.AddGroup(B_VERTICAL)
.Add(fLatch)
.Add(fMoreOptions)
.Add(icon)
.AddGlue()
.End()
.End();
.Add(fMoreOptions)
.AddGlue()
.AddGroup(B_VERTICAL)
.AddGlue()
.Add(icon)
.Add(button)
.End();
@@ -903,7 +897,6 @@ FindPanel::AttachedToWindow()
BNode* node = findWindow->QueryNode();
fSearchModeMenu->SetTargetForItems(this);
fQueryName->SetTarget(this);
fLatch->SetTarget(this);
RestoreMimeTypeMenuSelection(node);
// preselect the mime we used the last time have to do it here
// because AddByAttributeItems will build different menus based
@@ -2275,8 +2268,6 @@ FindPanel::SaveWindowState(BNode* node, bool editTemplate)
(int32*)&mode, sizeof(int32));
MoreOptionsStruct saveMoreOptions;
saveMoreOptions.showMoreOptions = fLatch->Value() != 0;
saveMoreOptions.searchTrash = fSearchTrashCheck->Value() != 0;
saveMoreOptions.temporary = fTemporaryCheck->Value() != 0;
@@ -2385,14 +2376,7 @@ FindPanel::RestoreWindowState(const BNode* node)
// need to sanitize to true or false here, could have picked
// up garbage from attributes
saveMoreOptions.showMoreOptions =
(saveMoreOptions.showMoreOptions != 0);
fLatch->SetValue(saveMoreOptions.showMoreOptions);
if (saveMoreOptions.showMoreOptions == 1 && fMoreOptions->IsHidden())
fMoreOptions->Show();
else if (saveMoreOptions.showMoreOptions == 0 && !fMoreOptions->IsHidden())
fMoreOptions->Hide();
saveMoreOptions.showMoreOptions = true; // Now unused
fSearchTrashCheck->SetValue(saveMoreOptions.searchTrash);
fTemporaryCheck->SetValue(saveMoreOptions.temporary);
+3 -2
View File
@@ -78,6 +78,8 @@ BMenu* TrackerBuildRecentFindItemsMenu(const char* title);
struct MoreOptionsStruct {
bool showMoreOptions;
// Some options used to be in a collapsable part of the window, but
// this was removed. Now the options are always visible.
bool searchTrash;
int32 reserved1;
bool temporary;
@@ -96,7 +98,7 @@ struct MoreOptionsStruct {
MoreOptionsStruct()
:
showMoreOptions(false),
showMoreOptions(true),
searchTrash(false),
reserved1(0),
temporary(true),
@@ -283,7 +285,6 @@ private:
BCheckBox* fTemporaryCheck;
BCheckBox* fSearchTrashCheck;
PaneSwitch* fLatch;
DraggableIcon* fDraggableIcon;
typedef BView _inherited;