@@ -7,7 +7,8 @@ import { MetaInfo } from "@gi-types/gobject2";
7
7
import { SnapAssistTile } from "./snapAssistTile" ;
8
8
import { SnapAssistLayout } from "./snapAssistLayout" ;
9
9
import { Layout } from "../layout/Layout" ;
10
- import { Tile } from "../layout/Tile" ;
10
+ import Tile from "../layout/Tile" ;
11
+ import Settings from "@/settings" ;
11
12
12
13
export const SNAP_ASSIST_SIGNAL = 'snap-assist' ;
13
14
export const SNAP_ASSIST_ANIMATION_TIME = 180 ;
@@ -33,6 +34,7 @@ export class SnapAssist extends BoxLayout {
33
34
private _shrinkHeight = 16 ;
34
35
// distance between layouts
35
36
private readonly _separatorSize = 8 ;
37
+ private readonly _gaps = 3 ;
36
38
37
39
private _showing : boolean ;
38
40
private _snapAssistLayouts : SnapAssistLayout [ ] ;
@@ -42,7 +44,7 @@ export class SnapAssist extends BoxLayout {
42
44
private _workArea : Rectangle = new Rectangle ( ) ;
43
45
private _hoveredTile : SnapAssistTile | undefined ;
44
46
45
- constructor ( parent : Actor , layouts : Layout [ ] , margin : Margin , workArea : Rectangle , scaleFactor : number ) {
47
+ constructor ( parent : Actor , workArea : Rectangle , scaleFactor : number ) {
46
48
super ( {
47
49
name : 'snap_assist' ,
48
50
x_align : ActorAlign . CENTER ,
@@ -57,13 +59,14 @@ export class SnapAssist extends BoxLayout {
57
59
58
60
this . _shrinkHeight *= scaleFactor ;
59
61
60
- const gap = 3 ;
62
+ const inner_gaps = Settings . get_inner_gaps ( 1 ) ;
61
63
const layoutGaps = new Margin ( {
62
- top : margin . top === 0 ? 0 :gap ,
63
- bottom : margin . bottom === 0 ? 0 :gap ,
64
- left : margin . left === 0 ? 0 :gap ,
65
- right : margin . right === 0 ? 0 :gap ,
66
- } )
64
+ top : inner_gaps . top === 0 ? 0 :this . _gaps ,
65
+ bottom : inner_gaps . bottom === 0 ? 0 :this . _gaps ,
66
+ left : inner_gaps . left === 0 ? 0 :this . _gaps ,
67
+ right : inner_gaps . right === 0 ? 0 :this . _gaps ,
68
+ } ) ;
69
+ const layouts = Settings . get_layouts ( ) ;
67
70
// build the layouts inside the snap assistant. Place a spacer between each layout
68
71
this . _snapAssistLayouts = layouts . map ( ( lay , ind ) => {
69
72
const saLay = new SnapAssistLayout ( this , lay , layoutGaps , scaleFactor ) ;
@@ -80,14 +83,10 @@ export class SnapAssist extends BoxLayout {
80
83
81
84
const padding = this . get_theme_node ( ) . get_padding ( Side . BOTTOM ) ;
82
85
const scaledPadding = ThemeContext . get_for_stage ( global . get_stage ( ) ) . get_scale_factor ( ) === 1 ?
83
- padding * scaleFactor :padding ;
86
+ ( padding * scaleFactor ) :padding ;
84
87
this . set_style ( `
85
88
padding: ${ scaledPadding } px !important;
86
89
` ) ;
87
- /*const color = this.get_theme_node().get_background_color();
88
- const newAlpha = 220;
89
- background-color: rgba(${color.red}, ${color.green}, ${color.blue}, ${newAlpha / 255}) !important;
90
- */
91
90
92
91
this . ensure_style ( ) ;
93
92
this . _enlargedRect . height = this . size . height ;
0 commit comments