add the resource for the window snapping offset
This commit is contained in:
parent
b34a0d1ce2
commit
b9e40b8b1e
3 changed files with 17 additions and 1 deletions
|
@ -490,6 +490,13 @@ void BScreen::saveSnapThreshold(int t) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BScreen::saveSnapOffset(int t) {
|
||||||
|
resource.snap_offset = t;
|
||||||
|
config->setValue(screenstr + "edgeSnapOffset",
|
||||||
|
resource.snap_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::saveRowPlacementDirection(int d) {
|
void BScreen::saveRowPlacementDirection(int d) {
|
||||||
resource.row_direction = d;
|
resource.row_direction = d;
|
||||||
config->setValue(screenstr + "rowPlacementDirection",
|
config->setValue(screenstr + "rowPlacementDirection",
|
||||||
|
@ -599,6 +606,7 @@ void BScreen::save_rc(void) {
|
||||||
saveWorkspaces(resource.workspaces);
|
saveWorkspaces(resource.workspaces);
|
||||||
savePlacementPolicy(resource.placement_policy);
|
savePlacementPolicy(resource.placement_policy);
|
||||||
saveSnapThreshold(resource.snap_threshold);
|
saveSnapThreshold(resource.snap_threshold);
|
||||||
|
saveSnapOffset(resource.snap_offset);
|
||||||
saveResistanceSize(resource.resistance_size);
|
saveResistanceSize(resource.resistance_size);
|
||||||
saveRowPlacementDirection(resource.row_direction);
|
saveRowPlacementDirection(resource.row_direction);
|
||||||
saveColPlacementDirection(resource.col_direction);
|
saveColPlacementDirection(resource.col_direction);
|
||||||
|
@ -673,6 +681,10 @@ void BScreen::load_rc(void) {
|
||||||
b = true;
|
b = true;
|
||||||
image_control->setDither(b);
|
image_control->setDither(b);
|
||||||
|
|
||||||
|
if (! config->getValue(screenstr + "edgeSnapOffset",
|
||||||
|
resource.snap_offset))
|
||||||
|
resource.snap_offset = 0;
|
||||||
|
|
||||||
if (! config->getValue(screenstr + "edgeSnapThreshold",
|
if (! config->getValue(screenstr + "edgeSnapThreshold",
|
||||||
resource.snap_threshold))
|
resource.snap_threshold))
|
||||||
resource.snap_threshold = 4;
|
resource.snap_threshold = 4;
|
||||||
|
|
|
@ -151,6 +151,7 @@ private:
|
||||||
ignore_shaded, ignore_maximized, workspace_warping;
|
ignore_shaded, ignore_maximized, workspace_warping;
|
||||||
|
|
||||||
int snap_to_windows, snap_to_edges;
|
int snap_to_windows, snap_to_edges;
|
||||||
|
unsigned int snap_offset;
|
||||||
|
|
||||||
BColor border_color;
|
BColor border_color;
|
||||||
|
|
||||||
|
@ -270,6 +271,8 @@ public:
|
||||||
{ return resource.workspaces; }
|
{ return resource.workspaces; }
|
||||||
inline int getPlacementPolicy(void) const
|
inline int getPlacementPolicy(void) const
|
||||||
{ return resource.placement_policy; }
|
{ return resource.placement_policy; }
|
||||||
|
inline int getSnapOffset(void) const
|
||||||
|
{ return resource.snap_offset; }
|
||||||
inline int getSnapThreshold(void) const
|
inline int getSnapThreshold(void) const
|
||||||
{ return resource.snap_threshold; }
|
{ return resource.snap_threshold; }
|
||||||
inline int getResistanceSize(void) const
|
inline int getResistanceSize(void) const
|
||||||
|
@ -290,6 +293,7 @@ public:
|
||||||
void saveRowPlacementDirection(int d);
|
void saveRowPlacementDirection(int d);
|
||||||
void saveColPlacementDirection(int d);
|
void saveColPlacementDirection(int d);
|
||||||
void saveSnapThreshold(int t);
|
void saveSnapThreshold(int t);
|
||||||
|
void saveSnapOffset(int o);
|
||||||
void saveResistanceSize(int s);
|
void saveResistanceSize(int s);
|
||||||
void saveImageDither(bool d);
|
void saveImageDither(bool d);
|
||||||
void saveAAFonts(bool f);
|
void saveAAFonts(bool f);
|
||||||
|
|
|
@ -3124,7 +3124,7 @@ void BlackboxWindow::doWindowSnapping(int &dx, int &dy) {
|
||||||
const int snap_to_windows = screen->getWindowToWindowSnap();
|
const int snap_to_windows = screen->getWindowToWindowSnap();
|
||||||
const int snap_to_edges = screen->getWindowToEdgeSnap();
|
const int snap_to_edges = screen->getWindowToEdgeSnap();
|
||||||
// the amount of space away from the edge to provide resistance/snap
|
// the amount of space away from the edge to provide resistance/snap
|
||||||
const int snap_offset = 0;
|
const int snap_offset = screen->getSnapOffset();
|
||||||
|
|
||||||
// find the geomeetery where the moving window currently is
|
// find the geomeetery where the moving window currently is
|
||||||
const Rect &moving = screen->doOpaqueMove() ? frame.rect : frame.changing;
|
const Rect &moving = screen->doOpaqueMove() ? frame.rect : frame.changing;
|
||||||
|
|
Loading…
Reference in a new issue