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

added minimal display #52

Merged
merged 1 commit into from
Nov 20, 2021
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
51 changes: 46 additions & 5 deletions [email protected]/components/stocks/menuStockTicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const SETTING_KEYS_TO_REFRESH = [
const TICKER_ITEM_VARIATION = {
COMPACT: 0,
REGULAR: 1,
TREMENDOUS: 2
TREMENDOUS: 2,
MINIMAL: 3
}

var MenuStockTicker = GObject.registerClass({
Expand Down Expand Up @@ -208,6 +209,42 @@ var MenuStockTicker = GObject.registerClass({
return stockInfoBox
}

_createMinimalTickerItemBox (quoteSummary) {
let { symbol, currencySymbol, price, change } = this._generateTickerInformation(quoteSummary)
const quoteColorStyleClass = getStockColorStyleClass(change)

currencySymbol = currencySymbol || ''

const stockInfoBox = new St.BoxLayout({
style_class: 'stock-info-box compact',
vertical: false,
y_align: Clutter.ActorAlign.CENTER,
y_expand: true
})

const stockNameLabel = new St.Label({
y_align: Clutter.ActorAlign.CENTER,
y_expand: true,
style_class: 'ticker-stock-name-label',
text: symbol
})

const stockQuoteLabel = new St.Label({
y_align: Clutter.ActorAlign.CENTER,
y_expand: true,
style_class: `ticker-stock-quote-label fwb ${quoteColorStyleClass}`,
text: `${roundOrDefault(price)}${currencySymbol}`
})

stockNameLabel.get_clutter_text().set_ellipsize(Pango.EllipsizeMode.NONE)
stockQuoteLabel.get_clutter_text().set_ellipsize(Pango.EllipsizeMode.NONE)

stockInfoBox.add_child(stockNameLabel)
stockInfoBox.add_child(stockQuoteLabel)

return stockInfoBox
}

_showInfoMessage (message) {
this.destroy_all_children()

Expand Down Expand Up @@ -273,12 +310,15 @@ var MenuStockTicker = GObject.registerClass({
case TICKER_ITEM_VARIATION.COMPACT:
return this._createCompactTickerItemBox

case TICKER_ITEM_VARIATION.TREMENDOUS:
return this._createTremendousTickerItemBox

case TICKER_ITEM_VARIATION.MINIMAL:
return this._createMinimalTickerItemBox

default:
case TICKER_ITEM_VARIATION.REGULAR:
return quoteSummary => this._createTremendousTickerItemBox(quoteSummary, true)

case TICKER_ITEM_VARIATION.TREMENDOUS:
return this._createTremendousTickerItemBox
}
}

Expand All @@ -289,7 +329,8 @@ var MenuStockTicker = GObject.registerClass({
price: quoteSummary.Close,
change: quoteSummary.Change,
changePercent: quoteSummary.ChangePercent,
isOffMarket: false
isOffMarket: false,
symbol: quoteSummary.Symbol
}

if (Settings.show_ticker_off_market_prices) {
Expand Down
32 changes: 18 additions & 14 deletions [email protected]/po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2021-04-01 15:16+0200\n"
"POT-Creation-Date: 2021-11-17 09:28-0500\n"
"PO-Revision-Date: 2020-11-30 14:42+0100\n"
"Last-Translator: [email protected]\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -135,65 +135,69 @@ msgstr ""
msgid "Tremendous"
msgstr ""

#: [email protected]/settings_40.ui:490 [email protected]/settings.ui:611
#: [email protected]/settings_40.ui:478 [email protected]/settings.ui:598
msgid "Minimal"
msgstr ""

#: [email protected]/settings_40.ui:491 [email protected]/settings.ui:612
#, fuzzy
msgid "Items to show in ticker"
msgstr "Im Ticker anzeigen?"

#: [email protected]/settings_40.ui:514 [email protected]/settings.ui:639
#: [email protected]/settings_40.ui:515 [email protected]/settings.ui:640
msgid "Stock Panel Ticker Interval in Seconds"
msgstr "Wechseninterval des Tickers in Sekunden"

#: [email protected]/settings_40.ui:538 [email protected]/settings.ui:667
#: [email protected]/settings_40.ui:539 [email protected]/settings.ui:668
#, fuzzy
msgid "Show off-market prices in Ticker"
msgstr "Im Ticker anzeigen?"

#: [email protected]/settings_40.ui:548 [email protected]/settings.ui:680
#: [email protected]/settings_40.ui:549 [email protected]/settings.ui:681
msgid ""
"If enabled the ticker will automatically show pre / post market prices if "
"available marked by a * sign."
msgstr ""

#: [email protected]/settings_40.ui:562 [email protected]/settings.ui:696
#: [email protected]/settings_40.ui:563 [email protected]/settings.ui:697
msgid "Use instrument names from provider"
msgstr ""

#: [email protected]/settings_40.ui:572 [email protected]/settings.ui:709
#: [email protected]/settings_40.ui:573 [email protected]/settings.ui:710
msgid "If enabled the names for instruments will be taken from provider data."
msgstr ""

#: [email protected]/settings_40.ui:586 [email protected]/settings.ui:727
#: [email protected]/settings_40.ui:587 [email protected]/settings.ui:728
msgid "General"
msgstr "Allgemein"

#: [email protected]/settings_40.ui:621 [email protected]/settings.ui:766
#: [email protected]/settings_40.ui:622 [email protected]/settings.ui:767
msgid "Version: "
msgstr ""

#: [email protected]/settings_40.ui:628 [email protected]/settings.ui:780
#: [email protected]/settings_40.ui:629 [email protected]/settings.ui:781
msgid "unknown (self-build ?)"
msgstr ""

#: [email protected]/settings_40.ui:637 [email protected]/settings.ui:800
#: [email protected]/settings_40.ui:638 [email protected]/settings.ui:801
msgid ""
"<span>Stocks-Extension is an extension to display and observe Stock quotes "
"in GNOME Shell Panel</span>"
msgstr ""

#: [email protected]/settings_40.ui:653 [email protected]/settings.ui:823
#: [email protected]/settings_40.ui:654 [email protected]/settings.ui:824
msgid "Maintained by"
msgstr ""

#: [email protected]/settings_40.ui:677 [email protected]/settings.ui:874
#: [email protected]/settings_40.ui:678 [email protected]/settings.ui:875
msgid ""
"<span size=\"small\">This program comes with ABSOLUTELY NO WARRANTY. See the "
"<a href=\"https://www.gnu.org/licenses/gpl\">GNU General Public License, "
"version 3 or later</a> for details.</span>\n"
" "
msgstr ""

#: [email protected]/settings_40.ui:691 [email protected]/settings.ui:897
#: [email protected]/settings_40.ui:692 [email protected]/settings.ui:898
msgid "About"
msgstr ""

Expand Down
36 changes: 20 additions & 16 deletions [email protected]/po/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell-extension-stocks\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2021-04-01 21:11+0200\n"
"POT-Creation-Date: 2021-11-17 09:28-0500\n"
"PO-Revision-Date: 2021-07-14 14:52+0200\n"
"Last-Translator: Heimen Stoffels <[email protected]>\n"
"Language-Team: Dutch <[email protected]>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0\n"
"Last-Translator: Heimen Stoffels <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: nl\n"

#: [email protected]/extension.js:63
msgid "Stocks"
Expand Down Expand Up @@ -134,60 +134,64 @@ msgstr "Normaal"
msgid "Tremendous"
msgstr "Groot"

#: [email protected]/settings_40.ui:490 [email protected]/settings.ui:611
#: [email protected]/settings_40.ui:478 [email protected]/settings.ui:598
msgid "Minimal"
msgstr "Minimal"

#: [email protected]/settings_40.ui:491 [email protected]/settings.ui:612
msgid "Items to show in ticker"
msgstr "Te tonen items op ticker"

#: [email protected]/settings_40.ui:514 [email protected]/settings.ui:639
#: [email protected]/settings_40.ui:515 [email protected]/settings.ui:640
msgid "Stock Panel Ticker Interval in Seconds"
msgstr "Bijwerktussenpoos van ticker (in seconden)"

#: [email protected]/settings_40.ui:538 [email protected]/settings.ui:667
#: [email protected]/settings_40.ui:539 [email protected]/settings.ui:668
msgid "Show off-market prices in Ticker"
msgstr "Prijzen buiten de markt tonen op ticker"

#: [email protected]/settings_40.ui:548 [email protected]/settings.ui:680
#: [email protected]/settings_40.ui:549 [email protected]/settings.ui:681
msgid ""
"If enabled the ticker will automatically show pre / post market prices if "
"available marked by a * sign."
msgstr ""
"Schakel in om de ticker automatisch prijzen van voor en na de marktwaarde te "
"markeren met ‘*’."

#: [email protected]/settings_40.ui:562 [email protected]/settings.ui:696
#: [email protected]/settings_40.ui:563 [email protected]/settings.ui:697
msgid "Use instrument names from provider"
msgstr "Instrumentnamen van dienst gebruiken"

#: [email protected]/settings_40.ui:572 [email protected]/settings.ui:709
#: [email protected]/settings_40.ui:573 [email protected]/settings.ui:710
msgid "If enabled the names for instruments will be taken from provider data."
msgstr ""
"Schakel in om de instrumentnamen uit de aangeleverde gegevens te halen."

#: [email protected]/settings_40.ui:586 [email protected]/settings.ui:727
#: [email protected]/settings_40.ui:587 [email protected]/settings.ui:728
msgid "General"
msgstr "Algemeen"

#: [email protected]/settings_40.ui:621 [email protected]/settings.ui:766
#: [email protected]/settings_40.ui:622 [email protected]/settings.ui:767
msgid "Version: "
msgstr "Versie: "

#: [email protected]/settings_40.ui:628 [email protected]/settings.ui:780
#: [email protected]/settings_40.ui:629 [email protected]/settings.ui:781
msgid "unknown (self-build ?)"
msgstr "onbekend (zelf-gecompileerd?)"

#: [email protected]/settings_40.ui:637 [email protected]/settings.ui:800
#: [email protected]/settings_40.ui:638 [email protected]/settings.ui:801
msgid ""
"<span>Stocks-Extension is an extension to display and observe Stock quotes "
"in GNOME Shell Panel</span>"
msgstr ""
"<span>Aandelen is een uitbreiding die aandelen toont en bijhoudt op de GNOME "
"Shell-bovenbalk</span>"

#: [email protected]/settings_40.ui:653 [email protected]/settings.ui:823
#: [email protected]/settings_40.ui:654 [email protected]/settings.ui:824
msgid "Maintained by"
msgstr "Beheerd door"

#: [email protected]/settings_40.ui:677 [email protected]/settings.ui:874
#: [email protected]/settings_40.ui:678 [email protected]/settings.ui:875
msgid ""
"<span size=\"small\">This program comes with ABSOLUTELY NO WARRANTY. See the "
"<a href=\"https://www.gnu.org/licenses/gpl\">GNU General Public License, "
Expand All @@ -199,7 +203,7 @@ msgstr ""
"Public License, versie 3 of hoger</a>.</span>\n"
" "

#: [email protected]/settings_40.ui:691 [email protected]/settings.ui:897
#: [email protected]/settings_40.ui:692 [email protected]/settings.ui:898
msgid "About"
msgstr "Over"

Expand Down
32 changes: 18 additions & 14 deletions [email protected]/po/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell-extension-stocks\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2021-04-01 21:11+0200\n"
"POT-Creation-Date: 2021-11-17 09:28-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -133,63 +133,67 @@ msgstr ""
msgid "Tremendous"
msgstr ""

#: [email protected]/settings_40.ui:490 [email protected]/settings.ui:611
#: [email protected]/settings_40.ui:478 [email protected]/settings.ui:598
msgid "Minimal"
msgstr ""

#: [email protected]/settings_40.ui:491 [email protected]/settings.ui:612
msgid "Items to show in ticker"
msgstr ""

#: [email protected]/settings_40.ui:514 [email protected]/settings.ui:639
#: [email protected]/settings_40.ui:515 [email protected]/settings.ui:640
msgid "Stock Panel Ticker Interval in Seconds"
msgstr ""

#: [email protected]/settings_40.ui:538 [email protected]/settings.ui:667
#: [email protected]/settings_40.ui:539 [email protected]/settings.ui:668
msgid "Show off-market prices in Ticker"
msgstr ""

#: [email protected]/settings_40.ui:548 [email protected]/settings.ui:680
#: [email protected]/settings_40.ui:549 [email protected]/settings.ui:681
msgid ""
"If enabled the ticker will automatically show pre / post market prices if "
"available marked by a * sign."
msgstr ""

#: [email protected]/settings_40.ui:562 [email protected]/settings.ui:696
#: [email protected]/settings_40.ui:563 [email protected]/settings.ui:697
msgid "Use instrument names from provider"
msgstr ""

#: [email protected]/settings_40.ui:572 [email protected]/settings.ui:709
#: [email protected]/settings_40.ui:573 [email protected]/settings.ui:710
msgid "If enabled the names for instruments will be taken from provider data."
msgstr ""

#: [email protected]/settings_40.ui:586 [email protected]/settings.ui:727
#: [email protected]/settings_40.ui:587 [email protected]/settings.ui:728
msgid "General"
msgstr ""

#: [email protected]/settings_40.ui:621 [email protected]/settings.ui:766
#: [email protected]/settings_40.ui:622 [email protected]/settings.ui:767
msgid "Version: "
msgstr ""

#: [email protected]/settings_40.ui:628 [email protected]/settings.ui:780
#: [email protected]/settings_40.ui:629 [email protected]/settings.ui:781
msgid "unknown (self-build ?)"
msgstr ""

#: [email protected]/settings_40.ui:637 [email protected]/settings.ui:800
#: [email protected]/settings_40.ui:638 [email protected]/settings.ui:801
msgid ""
"<span>Stocks-Extension is an extension to display and observe Stock quotes "
"in GNOME Shell Panel</span>"
msgstr ""

#: [email protected]/settings_40.ui:653 [email protected]/settings.ui:823
#: [email protected]/settings_40.ui:654 [email protected]/settings.ui:824
msgid "Maintained by"
msgstr ""

#: [email protected]/settings_40.ui:677 [email protected]/settings.ui:874
#: [email protected]/settings_40.ui:678 [email protected]/settings.ui:875
msgid ""
"<span size=\"small\">This program comes with ABSOLUTELY NO WARRANTY. See the "
"<a href=\"https://www.gnu.org/licenses/gpl\">GNU General Public License, "
"version 3 or later</a> for details.</span>\n"
" "
msgstr ""

#: [email protected]/settings_40.ui:691 [email protected]/settings.ui:897
#: [email protected]/settings_40.ui:692 [email protected]/settings.ui:898
msgid "About"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<value value="0" nick="compact"/>
<value value="1" nick="regular"/>
<value value="2" nick="tremendous"/> <!-- :D -->
<value value="3" nick="minimal"/>
</enum>
<enum id="org.gnome.shell.extensions.stocks.provider">
<value value="0" nick="yahoo"/>
Expand Down
1 change: 1 addition & 0 deletions [email protected]/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@
<item id="compact" translatable="yes">Compact</item>
<item id="regular" translatable="yes">Regular</item>
<item id="tremendous" translatable="yes">Tremendous</item>
<item id="minimal" translatable="yes">Minimal</item>
</items>
</object>
<packing>
Expand Down
1 change: 1 addition & 0 deletions [email protected]/settings_40.ui
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@
<item id="compact" translatable="yes">Compact</item>
<item id="regular" translatable="yes">Regular</item>
<item id="tremendous" translatable="yes">Tremendous</item>
<item id="minimal" translatable="yes">Minimal</item>
</items>
<layout>
<property name="column">1</property>
Expand Down