Skip to content

Commit d111177

Browse files
committed
ui: define viewportWidth to avoid horizontal scrollbar; minor style fix
1 parent 5adc46c commit d111177

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

ui/app/assets/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ html, body {
77

88
/* Scrolbar Styling */
99
::-webkit-scrollbar {
10-
width: 8px;
10+
width: 10px;
1111
height: 8px;
1212
}
1313
::-webkit-scrollbar-thumb {

ui/app/components/Kani.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { URL_MERGE_DIFF, MergeKaniColumns, multiSort, type VecMergeHashKaniList,
55
import { useDarkStore, useStyleStore } from "~/stores/style";
66
77
// Compute absolute scrollHeight for DataTable.
8-
const { color, viewportHeight } = storeToRefs(useStyleStore());
8+
const { color, viewportHeight, viewportWidth } = storeToRefs(useStyleStore());
99
const { fontColor } = storeToRefs(useDarkStore());
1010
1111
const raw = ref<VecMergeHashKaniList>([]);
@@ -35,8 +35,8 @@ useHead({ title: "Verify Rust Std - Kani" });
3535
<template>
3636

3737
<DataTable :value="raw" paginator :rows="5" :rowsPerPageOptions="[5, 10, 20, 50]" sortMode="multiple" removableSort
38-
v-model:multi-sort-meta="multiSort" stripedRows tableStyle="min-width: 20rem" tableClass="m-1"
39-
:scrollHeight="`${Math.round(viewportHeight * 0.78)}px`" v-model:filters="filters"
38+
v-model:multi-sort-meta="multiSort" stripedRows :tableStyle="{ width: `${Math.round(viewportWidth - 10)}px` }"
39+
tableClass="p-1" :scrollHeight="`${Math.round(viewportHeight * 0.78)}px`" v-model:filters="filters"
4040
:globalFilterFields="FILTERS.fields" currentPageReportTemplate="{first} to {last} of {totalRecords}">
4141

4242
<template #header>

ui/app/layouts/default.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (isInitDark) {
2626

2727
<template>
2828
<div>
29-
<div class="flex justify-between p-2">
29+
<div class="flex justify-between p-1">
3030
<div></div>
3131
<div>
3232
<Button :icon='dark ? "pi pi-sun" : "pi pi-moon"' @click="toggleTheme" severity="contrast" raised />

ui/app/shared/utils/kani.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface MergeKaniColumn {
3232
export const MergeKaniColumns: MergeKaniColumn[] = [
3333
{
3434
key: "file",
35-
col: { field: "file", header: "File Path", width: "18%", sortable: true },
35+
col: { field: "file", header: "File Path", width: "15%", sortable: true },
3636
},
3737
{
3838
key: "func",

ui/app/stores/style.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const useStyleStore = defineStore("style", () => {
44
primary: "white", orange: "orange", orange_light: "orange",
55
});
66
const viewportHeight = ref(800);
7+
const viewportWidth = ref(800);
78

89
onMounted(() => {
910
// Get styles after computation.
@@ -17,14 +18,16 @@ export const useStyleStore = defineStore("style", () => {
1718
color.orange_light = styles.getPropertyValue("--p-orange-400").trim();
1819
color.orange = styles.getPropertyValue("--p-orange-500").trim();
1920

20-
// Get heights
21+
// Get heights and widths.
2122
viewportHeight.value = window.innerHeight;
23+
viewportWidth.value = window.innerWidth;
2224
window.addEventListener("resize", () => {
2325
viewportHeight.value = window.innerHeight;
26+
viewportWidth.value = window.innerWidth;
2427
});
2528
});
2629

27-
return { color, viewportHeight }
30+
return { color, viewportHeight, viewportWidth }
2831
});
2932

3033
/** Styling based on dark theme mode. */

0 commit comments

Comments
 (0)