Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Enhancement (#1033) #1034

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7923,6 +7923,10 @@ speechSynthesis.getVoices();
'VRCX_notificationTTSNickName',
false
);

// It's not necessary to store it in configRepo because it's rarely used.
$app.data.isTestTTSVisible = false;

$app.data.notificationTTSVoice = await configRepository.getString(
'VRCX_notificationTTSVoice',
'0'
Expand Down Expand Up @@ -17188,6 +17192,18 @@ speechSynthesis.getVoices();
return style;
};

$app.methods.userFavoriteWorldsStatusForFavTab = function (visibility) {
let style = '';
if (visibility === 'public') {
style = '';
} else if (visibility === 'friends') {
style = 'success';
} else {
style = 'info';
}
return style;
};

$app.methods.changeWorldGroupVisibility = function (name, visibility) {
var params = {
type: 'world',
Expand Down Expand Up @@ -19659,6 +19675,23 @@ speechSynthesis.getVoices();
this.worldExportDialogVisible = true;
};

$app.methods.handleCopyWorldExportData = function (event) {
event.target.tagName === 'TEXTAREA' && event.target.select();
navigator.clipboard
.writeText(this.worldExportContent)
.then(() => {
this.$message({
message: 'Copied successfully!',
type: 'success',
duration: 2000
});
})
.catch((err) => {
console.error('Copy failed:', err);
this.$message.error('Copy failed!');
});
};

$app.methods.updateWorldExportDialog = function () {
const formatter = function (str) {
if (/[\x00-\x1f,"]/.test(str) === true) {
Expand Down Expand Up @@ -19924,6 +19957,23 @@ speechSynthesis.getVoices();
this.avatarExportDialogVisible = true;
};

$app.methods.handleCopyAvatarExportData = function (event) {
event.target.tagName === 'TEXTAREA' && event.target.select();
navigator.clipboard
.writeText(this.avatarExportContent)
.then(() => {
this.$message({
message: 'Copied successfully!',
type: 'success',
duration: 2000
});
})
.catch((err) => {
console.error('Copy failed:', err);
this.$message.error('Copy failed!');
});
};

/**
* Update the content of the avatar export dialog based on the selected options
*/
Expand Down Expand Up @@ -20165,6 +20215,23 @@ speechSynthesis.getVoices();
this.friendExportDialogVisible = true;
};

$app.methods.handleCopyFriendExportData = function (event) {
event.target.tagName === 'TEXTAREA' && event.target.select();
navigator.clipboard
.writeText(this.friendExportContent)
.then(() => {
this.$message({
message: 'Copied successfully!',
type: 'success',
duration: 2000
});
})
.catch((err) => {
console.error('Copy failed:', err);
this.$message.error('Copy failed!');
});
};

$app.methods.updateFriendExportDialog = function () {
var _ = function (str) {
if (/[\x00-\x1f,"]/.test(str) === true) {
Expand Down
43 changes: 40 additions & 3 deletions html/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ img.friends-list-avatar {
object-fit: cover;
}

.x-friend-item > .avatar.offline > img,
.x-friend-item > .avatar.active > img {
filter: grayscale(1);
}
Expand Down Expand Up @@ -731,7 +730,21 @@ i.x-status-icon.red {

.options-container-item .name {
display: inline-block;
min-width: 175px;
min-width: 225px;
}

.simple-switch {
font-size: 12px;
margin-top: 5px;
display: flex;
}

.simple-switch .name {
flex-basis: 225px;
}

.simple-switch .switch {
flex-shrink: 0;
}

.toggle-switch {
Expand All @@ -749,7 +762,7 @@ i.x-status-icon.red {
.toggle-list .toggle-name {
display: inline-block;
min-width: 190px;
padding-right: 5px;
padding-right: 10px;
text-align: right;
}

Expand Down Expand Up @@ -914,3 +927,27 @@ i.x-status-icon.red {
.el-pagination .el-input .el-input__icon {
line-height: 22px;
}

// User dialog memo: tag line-height
.el-dialog__body .el-tag--mini {
line-height: 17px;
}

// feed table detail time tag line-height
.el-table__expanded-cell .el-tag--mini {
line-height: 17px;
}

// User dialog memo: input count background color
.x-friend-item:hover .el-input__count {
background: #f0f0f0;
}

// Align the left page with the right friend bar
.x-app > .x-container {
padding-top: 15px;
}

.el-collapse-item .el-tag--mini {
line-height: 17px;
}
2 changes: 1 addition & 1 deletion html/src/classes/uiComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class extends baseClass {
'<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' +
'<span>{{ text }}</span></span>' +
'<span v-if="groupName" @click="showGroupDialog" :class="{ \'x-link\': link}">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block;margin-left:5px"></span>' +
'<span v-if="region" class="flags" :class="region" style="display:inline-block;margin-left:5px"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: {
location: String,
Expand Down
2 changes: 1 addition & 1 deletion html/src/mixins/dialogs/avatarDialog.pug
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mixin avatarDialog()
.x-friend-list
.x-friend-item(style="width:100%;cursor:default")
.detail
span.name {{ $t('dialog.avatar.info.memo') }}
span.name(style="margin-bottom:5px") {{ $t('dialog.avatar.info.memo') }}
el-input.extra(v-model="avatarDialog.memo" @change="onAvatarMemoChange" size="mini" type="textarea" :rows="2" :autosize="{minRows: 1, maxRows: 20}" :placeholder="$t('dialog.avatar.info.memo_placeholder')" resize="none")
.x-friend-item(style="width:100%;cursor:default")
.detail
Expand Down
Loading