1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-09-14 10:32:10 +02:00

Compare commits

...

17 Commits
1.7.4 ... 1.7.5

Author SHA1 Message Date
4c31e72d29 Release 1.7.5 2017-05-16 21:18:22 +02:00
e3b2ff7f0e Make bottom scrollbar slightly taller when rounded scrollbars are disabled 2017-05-16 21:18:15 +02:00
4c5f5e2cce Fix DM notifications not showing if the conversation is open 2017-05-16 20:23:08 +02:00
39ae9b8ba0 Fix multiple notifications showing for the same tweet in multiple columns 2017-05-16 17:15:02 +02:00
5c7eb0535d Fix formatting and insertRule call 2017-05-16 16:35:46 +02:00
235718390b Move reply icon tweaks to edit-design plugin, fix notification layout 2017-05-16 15:46:27 +02:00
5d4b72f224 Make notifications neater and more compact, fix list notification layout 2017-05-16 15:27:38 +02:00
dc76ae9d1f Make theme-based color tweaks in edit-design plugin optional 2017-05-16 02:13:48 +02:00
e44f4bb003 Move 'optimize animations' option in edit-design plugin into the leftmost column 2017-05-16 02:06:42 +02:00
1fc1370d41 Prevent notification windows from showing in Alt+Tab menu on Win 8/10 2017-05-16 02:04:43 +02:00
80a669c989 Add theme-based tweaks to edit-design plugin (background/scrollbar color) 2017-05-15 15:18:06 +02:00
801c9eba2d Move edit-design focus/blur events to ready() to avoid errors 2017-05-15 15:15:34 +02:00
f9704d2836 Move column container scrollbar to bottom to fit updated TweetDeck style 2017-05-15 15:01:38 +02:00
39687171e9 Close all dialog windows after starting an update download
Closes #120
2017-05-13 16:34:11 +02:00
1d73691ef4 Make edit-design plugin animation optimizations active only when focused 2017-05-13 16:02:29 +02:00
f8678d2515 Add a GetIdleSeconds method to the bridge object 2017-05-13 14:58:30 +02:00
fb108ea18d Release 1.7.4 2017-05-08 22:49:47 +02:00
7 changed files with 233 additions and 57 deletions

View File

@@ -83,6 +83,10 @@ namespace TweetDck.Core.Bridge{
form.InvokeAsyncSafe(WindowsUtils.ClipboardStripHtmlStyles); form.InvokeAsyncSafe(WindowsUtils.ClipboardStripHtmlStyles);
} }
public int GetIdleSeconds(){
return NativeMethods.GetIdleSeconds();
}
public void OpenBrowser(string url){ public void OpenBrowser(string url){
BrowserUtils.OpenExternalBrowser(url); BrowserUtils.OpenExternalBrowser(url);
} }

View File

@@ -279,6 +279,12 @@ namespace TweetDck.Core{
} }
private void updates_UpdateAccepted(object sender, UpdateAcceptedEventArgs e){ private void updates_UpdateAccepted(object sender, UpdateAcceptedEventArgs e){
foreach(Form form in Application.OpenForms.Cast<Form>().Reverse()){
if (form is FormSettings || form is FormPlugins || form is FormAbout){
form.Close();
}
}
Hide(); Hide();
FormUpdateDownload downloadForm = new FormUpdateDownload(e.UpdateInfo); FormUpdateDownload downloadForm = new FormUpdateDownload(e.UpdateInfo);

View File

@@ -54,7 +54,14 @@ namespace TweetDck.Core.Notification{
public new Point Location{ public new Point Location{
get => base.Location; get => base.Location;
set => Visible = (base.Location = value) != ControlExtensions.InvisibleLocation;
set{
Visible = (base.Location = value) != ControlExtensions.InvisibleLocation;
if (WindowsUtils.ShouldAvoidToolWindow){
FormBorderStyle = Visible ? FormBorderStyle.FixedSingle : FormBorderStyle.FixedToolWindow; // workaround for alt+tab
}
}
} }
public Func<bool> CanMoveWindow = () => true; public Func<bool> CanMoveWindow = () => true;
@@ -105,10 +112,6 @@ namespace TweetDck.Core.Notification{
this.browser.Dispose(); this.browser.Dispose();
this.owner.FormClosed -= owner_FormClosed; this.owner.FormClosed -= owner_FormClosed;
}; };
if (WindowsUtils.ShouldAvoidToolWindow){
FormBorderStyle = FormBorderStyle.FixedSingle;
}
// ReSharper disable once VirtualMemberCallInContructor // ReSharper disable once VirtualMemberCallInContructor
UpdateTitle(); UpdateTitle();

View File

@@ -20,8 +20,8 @@ namespace TweetDck{
public const string BrandName = "TweetDuck"; public const string BrandName = "TweetDuck";
public const string Website = "https://tweetduck.chylex.com"; public const string Website = "https://tweetduck.chylex.com";
public const string VersionTag = "1.7.3"; public const string VersionTag = "1.7.5";
public const string VersionFull = "1.7.3.0"; public const string VersionFull = "1.7.5.0";
public static readonly Version Version = new Version(VersionTag); public static readonly Version Version = new Version(VersionTag);
public static readonly bool IsPortable = File.Exists("makeportable"); public static readonly bool IsPortable = File.Exists("makeportable");

View File

@@ -16,6 +16,7 @@ enabled(){
hideTweetActions: true, hideTweetActions: true,
moveTweetActionsToRight: true, moveTweetActionsToRight: true,
revertReplies: false, revertReplies: false,
themeColorTweaks: true,
roundedScrollBars: false, roundedScrollBars: false,
smallComposeTextSize: false, smallComposeTextSize: false,
optimizeAnimations: true, optimizeAnimations: true,
@@ -200,6 +201,7 @@ enabled(){
setTimeout(function(){ setTimeout(function(){
TD.settings.setTheme($(this).attr("data-td-theme")); TD.settings.setTheme($(this).attr("data-td-theme"));
$(document).trigger("uiToggleTheme"); $(document).trigger("uiToggleTheme");
me.reinjectAll();
}, 1); }, 1);
}); });
}).methods({ }).methods({
@@ -228,6 +230,70 @@ enabled(){
this.$pluginSettings.requiresPageReload = enable; this.$pluginSettings.requiresPageReload = enable;
}; };
// animation optimization
this.optimizations = null;
this.optimizationTimer = null;
let clearOptimizationTimer = () => {
if (this.optimizationTimer){
window.clearTimeout(this.optimizationTimer);
this.optimizationTimer = null;
}
};
let runOptimizationTimer = timeout => {
if (!this.optimizationTimer){
this.optimizationTimer = window.setTimeout(optimizationTimerFunc, timeout);
}
};
let optimizationTimerFunc = () => {
this.optimizationTimer = null;
if (this.config.optimizeAnimations){
$TD.getIdleSeconds().then(s => {
if (s >= 16){
disableOptimizations();
runOptimizationTimer(2500);
}
else{
injectOptimizations();
}
});
}
};
let injectOptimizations = force => {
if (!this.optimizations && (force || document.hasFocus())){
this.optimizations = window.TDPF_createCustomStyle(this);
this.optimizations.insert(".app-content { will-change: transform }");
this.optimizations.insert(".column-holder { will-change: transform }");
}
clearOptimizationTimer();
runOptimizationTimer(10000);
};
let disableOptimizations = () => {
if (this.optimizations){
this.optimizations.remove();
this.optimizations = null;
}
};
this.onWindowFocusEvent = () => {
if (this.config.optimizeAnimations){
injectOptimizations(true);
}
};
this.onWindowBlurEvent = () => {
if (this.config.optimizeAnimations){
disableOptimizations();
clearOptimizationTimer();
}
};
// css and layout injection // css and layout injection
this.resetDesign = () => { this.resetDesign = () => {
if (this.css){ if (this.css){
@@ -240,12 +306,36 @@ enabled(){
this.reinjectAll = () => { this.reinjectAll = () => {
this.resetDesign(); this.resetDesign();
clearOptimizationTimer();
if (this.config.optimizeAnimations){
injectOptimizations();
}
else{
disableOptimizations();
}
this.css.insert("#general_settings .cf { display: none !important }"); this.css.insert("#general_settings .cf { display: none !important }");
this.css.insert("#general_settings .divider-bar::after { display: inline-block; padding-top: 10px; line-height: 17px; content: 'Use the new | Edit layout & design | option in the Settings to modify TweetDeck theme, column width, font size, and other features.' }"); this.css.insert("#general_settings .divider-bar::after { display: inline-block; padding-top: 10px; line-height: 17px; content: 'Use the new | Edit layout & design | option in the Settings to modify TweetDeck theme, column width, font size, and other features.' }");
this.css.insert(".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }"); this.css.insert(".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }");
this.css.insert(".avatar { border-radius: "+this.config.avatarRadius+"% !important }"); this.css.insert(".avatar { border-radius: "+this.config.avatarRadius+"% !important }");
if (this.config.themeColorTweaks){
switch(TD.settings.getTheme()){
case "dark":
this.css.insert(".app-content, .app-columns-container { background-color: #444448 }");
this.css.insert(".column-drag-handle { opacity: 0.5 }");
this.css.insert(".column-drag-handle:hover { opacity: 1 }");
break;
case "light":
this.css.insert(".scroll-styled-v::-webkit-scrollbar-thumb, .scroll-styled-h::-webkit-scrollbar-thumb { background-color: #d2d6da }");
this.css.insert(".app-columns-container.scroll-styled-h::-webkit-scrollbar-thumb:not(:hover) { background-color: #a5aeb5 }");
break;
}
}
if (this.config.hideTweetActions){ if (this.config.hideTweetActions){
this.css.insert(".tweet-action { opacity: 0; }"); this.css.insert(".tweet-action { opacity: 0; }");
this.css.insert(".is-favorite .tweet-action, .is-retweet .tweet-action { opacity: 0.5; visibility: visible !important }"); this.css.insert(".is-favorite .tweet-action, .is-retweet .tweet-action { opacity: 0.5; visibility: visible !important }");
@@ -269,11 +359,12 @@ enabled(){
this.css.insert(".antiscroll-scrollbar { border-radius: 0 }"); this.css.insert(".antiscroll-scrollbar { border-radius: 0 }");
this.css.insert(".antiscroll-scrollbar-vertical { margin-top: 0 }"); this.css.insert(".antiscroll-scrollbar-vertical { margin-top: 0 }");
this.css.insert(".antiscroll-scrollbar-horizontal { margin-left: 0 }"); this.css.insert(".antiscroll-scrollbar-horizontal { margin-left: 0 }");
this.css.insert(".app-columns-container::-webkit-scrollbar { height: 9px !important }");
} }
if (this.config.optimizeAnimations){ if (this.config.revertReplies){
this.css.insert(".app-content { will-change: transform }"); this.css.insert(".activity-header + .tweet .tweet-context { margin-left: -35px }");
this.css.insert(".column-holder { will-change: transform }"); this.css.insert(".activity-header + .tweet .tweet-context .obj-left { margin-right: 5px }");
} }
if (this.config.columnWidth[0] === '/'){ if (this.config.columnWidth[0] === '/'){
@@ -312,6 +403,7 @@ enabled(){
"<style type='text/css'>", "<style type='text/css'>",
".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }", ".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }",
".avatar { border-radius: "+this.config.avatarRadius+"% !important }", ".avatar { border-radius: "+this.config.avatarRadius+"% !important }",
(this.config.revertReplies ? ".activity-header + .tweet .tweet-context { margin-left: -35px } .activity-header + .tweet .tweet-context .obj-left { margin-right: 5px }" : ""),
"</style>" "</style>"
].join("")); ].join(""));
}; };
@@ -339,6 +431,10 @@ ready(){
this.onAppReady(); this.onAppReady();
// optimization events
$(window).on("focus", this.onWindowFocusEvent);
$(window).on("blur", this.onWindowBlurEvent);
// layout events // layout events
$(document).on("uiShowActionsMenu", this.uiShowActionsMenuEvent); $(document).on("uiShowActionsMenu", this.uiShowActionsMenuEvent);
@@ -352,7 +448,17 @@ disabled(){
this.css.remove(); this.css.remove();
} }
if (this.optimizations){
this.optimizations.remove();
}
if (this.optimizationTimer){
window.clearTimeout(this.optimizationTimer);
}
$(document).off("uiShowActionsMenu", this.uiShowActionsMenuEvent); $(document).off("uiShowActionsMenu", this.uiShowActionsMenuEvent);
$(window).off("focus", this.onWindowFocusEvent);
$(window).off("blur", this.onWindowBlurEvent);
$("[data-action='settings-menu']").off("click", this.onSettingsMenuClickedEvent); $("[data-action='settings-menu']").off("click", this.onSettingsMenuClickedEvent);
$("#td-design-plugin-modal").remove(); $("#td-design-plugin-modal").remove();

View File

@@ -61,6 +61,16 @@
<option value="16px">Largest (16px)</option> <option value="16px">Largest (16px)</option>
<option value="custom">Custom</option> <option value="custom">Custom</option>
</select> </select>
<!-- ADVANCED -->
<label class="txt-uppercase touch-larger-label">
<b>Advanced</b>
</label>
<label class="checkbox">
<input data-td-key="optimizeAnimations" class="js-theme-checkbox touch-larger-label" type="checkbox">
Use more memory for smoother animations
</label>
</div> </div>
<div class="l-column mdl-column"> <div class="l-column mdl-column">
@@ -88,6 +98,10 @@
<label class="txt-uppercase touch-larger-label"> <label class="txt-uppercase touch-larger-label">
<b>Design</b> <b>Design</b>
</label> </label>
<label class="checkbox">
<input data-td-key="themeColorTweaks" class="js-theme-checkbox touch-larger-label" type="checkbox">
Theme color tweaks
</label>
<label class="checkbox"> <label class="checkbox">
<input data-td-key="roundedScrollBars" class="js-theme-checkbox touch-larger-label" type="checkbox"> <input data-td-key="roundedScrollBars" class="js-theme-checkbox touch-larger-label" type="checkbox">
Rounded scroll bars Rounded scroll bars
@@ -96,16 +110,6 @@
<input data-td-key="smallComposeTextSize" class="js-theme-checkbox touch-larger-label" type="checkbox"> <input data-td-key="smallComposeTextSize" class="js-theme-checkbox touch-larger-label" type="checkbox">
Small compose tweet font size Small compose tweet font size
</label> </label>
<!-- ADVANCED -->
<label class="txt-uppercase touch-larger-label">
<b>Advanced</b>
</label>
<label class="checkbox">
<input data-td-key="optimizeAnimations" class="js-theme-checkbox touch-larger-label" type="checkbox">
Optimize animations (uses more memory for smoother animations)
</label>
</div> </div>
<div class="l-column mdl-column"> <div class="l-column mdl-column">
@@ -153,7 +157,7 @@
.td-modal-panel { .td-modal-panel {
width: 693px; width: 693px;
height: 374px; height: 380px;
} }
.td-modal-inner-cols { .td-modal-inner-cols {

View File

@@ -80,38 +80,76 @@
// //
// Function: Event callback for a new tweet. // Function: Event callback for a new tweet.
// //
var onNewTweet = function(column, tweet){ var onNewTweet = (function(){
if (column.model.getHasNotification()){ let recentTweets = new Set();
let html = $(tweet.render({ let recentTweetTimer = null;
withFooter: false,
withTweetActions: false,
withMediaPreview: true,
isMediaPreviewOff: true,
isMediaPreviewSmall: false,
isMediaPreviewLarge: false
}));
html.css("border", "0");
html.find("footer").last().remove(); // apparently withTweetActions breaks for certain tweets, nice
html.find(".js-media").last().remove(); // and quoted tweets still show media previews, nice nice
html.find(".js-quote-detail").removeClass("is-actionable"); // prevent quoted tweets from changing the cursor
html.find("a[href='#']").each(function(){ // remove <a> tags around links that don't lead anywhere (such as account names the tweet replied to)
this.outerHTML = this.innerHTML;
});
let source = tweet.getRelatedTweet();
let duration = source ? source.text.length+(source.quotedTweet ? source.quotedTweet.text.length : 0) : tweet.text.length;
let tweetUrl = source ? source.getChirpURL() : "";
let quoteUrl = source && source.quotedTweet ? source.quotedTweet.getChirpURL() : "";
$TD.onTweetPopup(columnTypes[column.getColumnType()] || "", html.html(), duration, tweetUrl, quoteUrl);
}
if (column.model.getHasSound()){ let startRecentTweetTimer = () => {
$TD.onTweetSound(); if (recentTweetTimer){
} window.clearTimeout(recentTweetTimer);
}; }
recentTweetTimer = window.setTimeout(() => {
recentTweetTimer = null;
recentTweets.clear();
}, 10000);
};
let checkRecentTweet = id => {
if (recentTweets.size > 50){
recentTweets.clear();
}
else if (recentTweets.has(id)){
return true;
}
recentTweets.add(id);
startRecentTweetTimer();
return false;
};
return function(column, tweet){
if (checkRecentTweet(tweet.id)){
return;
}
if (column.model.getHasNotification()){
let html = $(tweet.render({
withFooter: false,
withTweetActions: false,
withMediaPreview: true,
isMediaPreviewOff: true,
isMediaPreviewSmall: false,
isMediaPreviewLarge: false
}));
html.css("border", "0");
html.find("footer").last().remove(); // apparently withTweetActions breaks for certain tweets, nice
html.find(".js-media").last().remove(); // and quoted tweets still show media previews, nice nice
html.find(".js-quote-detail").removeClass("is-actionable"); // prevent quoted tweets from changing the cursor
html.find("a[href='#']").each(function(){ // remove <a> tags around links that don't lead anywhere (such as account names the tweet replied to)
this.outerHTML = this.innerHTML;
});
if (tweet.getChirpType().includes("list_member")){
html.find(".activity-header").first().css("margin-top", "2px");
html.find(".avatar").first().css("margin-bottom", "0");
}
let source = tweet.getRelatedTweet();
let duration = source ? source.text.length+(source.quotedTweet ? source.quotedTweet.text.length : 0) : tweet.text.length;
let tweetUrl = source ? source.getChirpURL() : "";
let quoteUrl = source && source.quotedTweet ? source.quotedTweet.getChirpURL() : "";
$TD.onTweetPopup(columnTypes[column.getColumnType()] || "", html.html(), duration, tweetUrl, quoteUrl);
}
if (column.model.getHasSound()){
$TD.onTweetSound();
}
};
})();
// //
// Function: Retrieves the tags to be put into <head> for notification HTML code. // Function: Retrieves the tags to be put into <head> for notification HTML code.
@@ -127,6 +165,8 @@
tags.push("body { background: "+getClassStyleProperty("column", "background-color")+" }"); // set background color tags.push("body { background: "+getClassStyleProperty("column", "background-color")+" }"); // set background color
tags.push("a[data-full-url] { word-break: break-all }"); // break long urls tags.push("a[data-full-url] { word-break: break-all }"); // break long urls
tags.push(".txt-base-smallest .badge-verified:before { height: 13px !important }"); // fix cut off badge icon tags.push(".txt-base-smallest .badge-verified:before { height: 13px !important }"); // fix cut off badge icon
tags.push(".activity-header { align-items: center !important; margin-bottom: 4px }"); // tweak alignment of avatar and text in notifications
tags.push(".activity-header .tweet-timestamp { line-height: unset }"); // fix timestamp position in notifications
tags.push("</style>"); tags.push("</style>");
return tags.join(""); return tags.join("");
@@ -548,12 +588,14 @@
styleOfficial.sheet.insertRule(".txt-base-smallest .sprite-verified-mini { width: 13px !important; height: 13px !important; background-position: -223px -99px !important; }", 0); // fix cut off badge icon when zoomed in styleOfficial.sheet.insertRule(".txt-base-smallest .sprite-verified-mini { width: 13px !important; height: 13px !important; background-position: -223px -99px !important; }", 0); // fix cut off badge icon when zoomed in
styleOfficial.sheet.insertRule(".keyboard-shortcut-list { vertical-align: top; }", 0); // fix keyboard navigation alignment styleOfficial.sheet.insertRule(".keyboard-shortcut-list { vertical-align: top; }", 0); // fix keyboard navigation alignment
styleOfficial.sheet.insertRule(".sprite-logo { background-position: -5px -46px !important; }", 0); // fix TweetDeck logo on certain zoom levels styleOfficial.sheet.insertRule(".sprite-logo { background-position: -5px -46px !important; }", 0); // fix TweetDeck logo on certain zoom levels
styleOfficial.sheet.insertRule(".app-columns-container::-webkit-scrollbar-track { border-left: 0 }", 0); // remove weird border in the column container scrollbar styleOfficial.sheet.insertRule(".app-navigator .tooltip { display: none !important; }", 0); // hide broken tooltips in the menu
styleOfficial.sheet.insertRule(".app-navigator .tooltip { display: none !important }", 0); // hide broken tooltips in the menu styleOfficial.sheet.insertRule(".account-inline .username { vertical-align: 10%; }", 0); // move usernames a bit higher
styleOfficial.sheet.insertRule(".account-inline .username { vertical-align: 10% }", 0); // move usernames a bit higher
styleOfficial.sheet.insertRule(".js-accounts-column-holder { bottom: 4px; }", 0); // fix white bar on the bottom styleOfficial.sheet.insertRule(".activity-header { align-items: center !important; margin-bottom: 4px; }", 0); // tweak alignment of avatar and text in notifications
styleOfficial.sheet.insertRule(".drawer[data-drawer='accountSettings'] { background-color: #ccd6dd; }", 0); // fix white bar on the bottom styleOfficial.sheet.insertRule(".activity-header .tweet-timestamp { line-height: unset }", 0); // fix timestamp position in notifications
styleOfficial.sheet.insertRule(".app-columns-container::-webkit-scrollbar-track { border-left: 0; }", 0); // remove weird border in the column container scrollbar
styleOfficial.sheet.insertRule(".app-columns-container { bottom: 0 !important; }", 0); // move column container scrollbar to bottom to fit updated style
styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']), .is-gif .js-media-gif-container { cursor: alias; }", 0); // change cursor on unsupported videos styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']), .is-gif .js-media-gif-container { cursor: alias; }", 0); // change cursor on unsupported videos
styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']) .icon-bg-dot, .is-gif .icon-bg-dot { color: #bd3d37; }", 0); // change play icon color on unsupported videos styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']) .icon-bg-dot, .is-gif .icon-bg-dot { color: #bd3d37; }", 0); // change play icon color on unsupported videos
@@ -619,6 +661,17 @@
}, 100); }, 100);
}); });
//
// Block: Fix DM notifications not showing if the conversation is open.
//
(function(prevFunc){
TD.services.TwitterConversation.prototype.getUnreadChirps = function(e){
return (e && e.sortIndex && !e.id && !this.notificationsDisabled)
? this.messages.filter(t => t.chirpType === TD.services.ChirpBase.MESSAGE && !t.isOwnChirp() && !t.read && !t.belongsBelow(e)) // changed from belongsAbove
: prevFunc.apply(this, arguments);
};
})(TD.services.TwitterConversation.prototype.getUnreadChirps);
// //
// Block: Disable TweetDeck metrics. // Block: Disable TweetDeck metrics.
// //