Skip to content

Commit 66f1100

Browse files
committed
Fix custom watchlist icon/buttons in the config UI sometimes going on the wrong line
1 parent cebf505 commit 66f1100

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

options.lua

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ function ns:CreateCustomFramesPriorityListOptions(order, swapWatchlistFrames)
441441

442442
return options;
443443
end
444+
local numberOfIcons = 4;
445+
local iconWidth = 26;
446+
local groupWidth = 405; -- depends on whether there's a scrollbar
444447
for i, frame in ipairs(self.orderedCustomFrames) do
445448
options.args["glow" .. i] = {
446449
order = increment(),
@@ -459,14 +462,14 @@ function ns:CreateCustomFramesPriorityListOptions(order, swapWatchlistFrames)
459462
imageCoords = {
460463
search.leftTexCoord, search.rightTexCoord, search.topTexCoord, search.bottomTexCoord,
461464
},
462-
width = 26 / width_multiplier,
465+
width = iconWidth / width_multiplier,
463466
};
464467
options.args["name" .. i] = {
465468
order = increment(),
466469
name = frame,
467470
type = "description",
468471
fontSize = "medium",
469-
width = (400 - 30 * 3) / width_multiplier,
472+
width = (groupWidth - iconWidth * numberOfIcons) / width_multiplier,
470473
};
471474
options.args["up" .. i] = {
472475
order = increment(),
@@ -486,7 +489,7 @@ function ns:CreateCustomFramesPriorityListOptions(order, swapWatchlistFrames)
486489
arrowBack.leftTexCoord, arrowBack.topTexCoord, -- UR
487490
arrowBack.rightTexCoord, arrowBack.topTexCoord, -- LR
488491
},
489-
width = 26 / width_multiplier,
492+
width = iconWidth / width_multiplier,
490493
};
491494
options.args["down" .. i] = {
492495
order = increment(),
@@ -500,7 +503,7 @@ function ns:CreateCustomFramesPriorityListOptions(order, swapWatchlistFrames)
500503
image = arrowNext.file,
501504
imageWidth = 16,
502505
imageHeight = 16,
503-
width = 26 / width_multiplier,
506+
width = iconWidth / width_multiplier,
504507
imageCoords = {
505508
arrowNext.leftTexCoord, arrowNext.bottomTexCoord, -- UL
506509
arrowNext.rightTexCoord, arrowNext.bottomTexCoord, -- LL
@@ -522,7 +525,13 @@ function ns:CreateCustomFramesPriorityListOptions(order, swapWatchlistFrames)
522525
imageCoords = {
523526
cross.leftTexCoord, cross.rightTexCoord, cross.topTexCoord, cross.bottomTexCoord,
524527
},
525-
width = 26 / width_multiplier,
528+
width = iconWidth / width_multiplier,
529+
};
530+
options.args["spacer" .. i] = {
531+
order = increment(),
532+
name = "",
533+
type = "description",
534+
width = "full",
526535
};
527536
end
528537

0 commit comments

Comments
 (0)