Tracker: tweak FindPanel layout again
- Remove the "more options" latch - Put the icon back on the left. Fixes #16015
This commit is contained in:
@@ -50,6 +50,7 @@ All rights reserved.
|
|||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
|
#include <Cursor.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
@@ -779,6 +780,8 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
|
|||||||
fDraggableIcon->SetExplicitMaxSize(
|
fDraggableIcon->SetExplicitMaxSize(
|
||||||
BSize(draggableRect.right - draggableRect.left,
|
BSize(draggableRect.right - draggableRect.left,
|
||||||
draggableRect.bottom - draggableRect.top));
|
draggableRect.bottom - draggableRect.top));
|
||||||
|
BCursor grabCursor(B_CURSOR_ID_GRAB);
|
||||||
|
fDraggableIcon->SetViewCursor(&grabCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
fQueryName = new BTextControl("query name", B_TRANSLATE("Query name:"),
|
fQueryName = new BTextControl("query name", B_TRANSLATE("Query name:"),
|
||||||
@@ -805,14 +808,6 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
|
|||||||
.End()
|
.End()
|
||||||
.View());
|
.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
|
// add Search button
|
||||||
BButton* button;
|
BButton* button;
|
||||||
if (editTemplateOnly) {
|
if (editTemplateOnly) {
|
||||||
@@ -864,14 +859,13 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
|
|||||||
.Add(queryBox)
|
.Add(queryBox)
|
||||||
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
||||||
.AddGroup(B_VERTICAL)
|
.AddGroup(B_VERTICAL)
|
||||||
.Add(fLatch)
|
.Add(icon)
|
||||||
.Add(fMoreOptions)
|
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End()
|
.End();
|
||||||
|
.Add(fMoreOptions)
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.AddGroup(B_VERTICAL)
|
.AddGroup(B_VERTICAL)
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.Add(icon)
|
|
||||||
.Add(button)
|
.Add(button)
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
@@ -903,7 +897,6 @@ FindPanel::AttachedToWindow()
|
|||||||
BNode* node = findWindow->QueryNode();
|
BNode* node = findWindow->QueryNode();
|
||||||
fSearchModeMenu->SetTargetForItems(this);
|
fSearchModeMenu->SetTargetForItems(this);
|
||||||
fQueryName->SetTarget(this);
|
fQueryName->SetTarget(this);
|
||||||
fLatch->SetTarget(this);
|
|
||||||
RestoreMimeTypeMenuSelection(node);
|
RestoreMimeTypeMenuSelection(node);
|
||||||
// preselect the mime we used the last time have to do it here
|
// preselect the mime we used the last time have to do it here
|
||||||
// because AddByAttributeItems will build different menus based
|
// because AddByAttributeItems will build different menus based
|
||||||
@@ -2275,8 +2268,6 @@ FindPanel::SaveWindowState(BNode* node, bool editTemplate)
|
|||||||
(int32*)&mode, sizeof(int32));
|
(int32*)&mode, sizeof(int32));
|
||||||
|
|
||||||
MoreOptionsStruct saveMoreOptions;
|
MoreOptionsStruct saveMoreOptions;
|
||||||
saveMoreOptions.showMoreOptions = fLatch->Value() != 0;
|
|
||||||
|
|
||||||
saveMoreOptions.searchTrash = fSearchTrashCheck->Value() != 0;
|
saveMoreOptions.searchTrash = fSearchTrashCheck->Value() != 0;
|
||||||
saveMoreOptions.temporary = fTemporaryCheck->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
|
// need to sanitize to true or false here, could have picked
|
||||||
// up garbage from attributes
|
// up garbage from attributes
|
||||||
|
|
||||||
saveMoreOptions.showMoreOptions =
|
saveMoreOptions.showMoreOptions = true; // Now unused
|
||||||
(saveMoreOptions.showMoreOptions != 0);
|
|
||||||
|
|
||||||
fLatch->SetValue(saveMoreOptions.showMoreOptions);
|
|
||||||
if (saveMoreOptions.showMoreOptions == 1 && fMoreOptions->IsHidden())
|
|
||||||
fMoreOptions->Show();
|
|
||||||
else if (saveMoreOptions.showMoreOptions == 0 && !fMoreOptions->IsHidden())
|
|
||||||
fMoreOptions->Hide();
|
|
||||||
|
|
||||||
fSearchTrashCheck->SetValue(saveMoreOptions.searchTrash);
|
fSearchTrashCheck->SetValue(saveMoreOptions.searchTrash);
|
||||||
fTemporaryCheck->SetValue(saveMoreOptions.temporary);
|
fTemporaryCheck->SetValue(saveMoreOptions.temporary);
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ BMenu* TrackerBuildRecentFindItemsMenu(const char* title);
|
|||||||
|
|
||||||
struct MoreOptionsStruct {
|
struct MoreOptionsStruct {
|
||||||
bool showMoreOptions;
|
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;
|
bool searchTrash;
|
||||||
int32 reserved1;
|
int32 reserved1;
|
||||||
bool temporary;
|
bool temporary;
|
||||||
@@ -96,7 +98,7 @@ struct MoreOptionsStruct {
|
|||||||
|
|
||||||
MoreOptionsStruct()
|
MoreOptionsStruct()
|
||||||
:
|
:
|
||||||
showMoreOptions(false),
|
showMoreOptions(true),
|
||||||
searchTrash(false),
|
searchTrash(false),
|
||||||
reserved1(0),
|
reserved1(0),
|
||||||
temporary(true),
|
temporary(true),
|
||||||
@@ -283,7 +285,6 @@ private:
|
|||||||
BCheckBox* fTemporaryCheck;
|
BCheckBox* fTemporaryCheck;
|
||||||
BCheckBox* fSearchTrashCheck;
|
BCheckBox* fSearchTrashCheck;
|
||||||
|
|
||||||
PaneSwitch* fLatch;
|
|
||||||
DraggableIcon* fDraggableIcon;
|
DraggableIcon* fDraggableIcon;
|
||||||
|
|
||||||
typedef BView _inherited;
|
typedef BView _inherited;
|
||||||
|
|||||||
Reference in New Issue
Block a user