Remember the mouse snapping mode across sessions... fixes #4740.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35252 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -70,7 +70,7 @@ class CanvasView : public StateView,
|
|||||||
{ return fZoomLevel; }
|
{ return fZoomLevel; }
|
||||||
|
|
||||||
void SetMouseFilterMode(uint32 mode);
|
void SetMouseFilterMode(uint32 mode);
|
||||||
bool MouseFilterMode() const
|
uint32 MouseFilterMode() const
|
||||||
{ return fMouseFilterMode; }
|
{ return fMouseFilterMode; }
|
||||||
|
|
||||||
void ConvertFromCanvas(BPoint* point) const;
|
void ConvertFromCanvas(BPoint* point) const;
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ MainWindow::MainWindow(IconEditorApp* app, Document* document,
|
|||||||
fDocument(document),
|
fDocument(document),
|
||||||
fIcon(NULL)
|
fIcon(NULL)
|
||||||
{
|
{
|
||||||
RestoreSettings(settings);
|
|
||||||
|
|
||||||
_Init();
|
_Init();
|
||||||
|
|
||||||
|
RestoreSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
@@ -508,8 +508,13 @@ MainWindow::SetIcon(Icon* icon)
|
|||||||
void
|
void
|
||||||
MainWindow::StoreSettings(BMessage* archive)
|
MainWindow::StoreSettings(BMessage* archive)
|
||||||
{
|
{
|
||||||
if (archive->ReplaceRect("main window frame", Frame()) < B_OK)
|
if (archive->ReplaceRect("main window frame", Frame()) != B_OK)
|
||||||
archive->AddRect("main window frame", Frame());
|
archive->AddRect("main window frame", Frame());
|
||||||
|
if (archive->ReplaceUInt32("mouse filter mode",
|
||||||
|
fCanvasView->MouseFilterMode()) != B_OK) {
|
||||||
|
archive->AddUInt32("mouse filter mode",
|
||||||
|
fCanvasView->MouseFilterMode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RestoreSettings
|
// RestoreSettings
|
||||||
@@ -522,6 +527,9 @@ MainWindow::RestoreSettings(const BMessage* archive)
|
|||||||
MoveTo(frame.LeftTop());
|
MoveTo(frame.LeftTop());
|
||||||
ResizeTo(frame.Width(), frame.Height());
|
ResizeTo(frame.Width(), frame.Height());
|
||||||
}
|
}
|
||||||
|
uint32 mouseFilterMode;
|
||||||
|
if (archive->FindUInt32("mouse filter mode", &mouseFilterMode) == B_OK)
|
||||||
|
fCanvasView->SetMouseFilterMode(mouseFilterMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|||||||
Reference in New Issue
Block a user